<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>MCTS -- Windows - Based Client Development</title>
	<atom:link href="http://mcts2005.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://mcts2005.wordpress.com</link>
	<description>Just another WordPress.com weblog</description>
	<lastBuildDate>Wed, 30 Jan 2008 11:40:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='mcts2005.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>MCTS -- Windows - Based Client Development</title>
		<link>http://mcts2005.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://mcts2005.wordpress.com/osd.xml" title="MCTS -- Windows - Based Client Development" />
	<atom:link rel='hub' href='http://mcts2005.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Some key points to remember on Threading</title>
		<link>http://mcts2005.wordpress.com/2008/01/30/some-key-points-to-remember-on-threading/</link>
		<comments>http://mcts2005.wordpress.com/2008/01/30/some-key-points-to-remember-on-threading/#comments</comments>
		<pubDate>Wed, 30 Jan 2008 11:40:41 +0000</pubDate>
		<dc:creator>piyusht</dc:creator>
				<category><![CDATA[C# MCTS]]></category>

		<guid isPermaLink="false">http://mcts2005.wordpress.com/?p=14</guid>
		<description><![CDATA[Here are some key points that I&#8217;ve found while going through the Threading chapter. To perform work concurrently, use the Thread class. To start thread execution, use the Thread class’s Start method. To wait on threads to complete, use the Thread class’s Join method. To cancel execution of a thread, use the Thread class’s Abort [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mcts2005.wordpress.com&amp;blog=2471586&amp;post=14&amp;subd=mcts2005&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Here are some key points that I&#8217;ve found while going through the Threading chapter.</p>
<ol>
<li class="MsoNormal"><span style="font-size:10pt;font-family:Verdana;">To      perform work concurrently, use the </span><i><span style="font-size:10pt;font-family:Verdana;">Thread      </span></i><span style="font-size:10pt;font-family:Verdana;">class.</span></li>
<li class="MsoNormal"><span style="font-size:10pt;font-family:Verdana;">To      start thread execution, use the </span><i><span style="font-size:10pt;font-family:Verdana;">Thread      </span></i><span style="font-size:10pt;font-family:Verdana;">class’s </span><i><span style="font-size:10pt;font-family:Verdana;">Start </span></i><span style="font-size:10pt;font-family:Verdana;">method.</span></li>
<li class="MsoNormal"><span style="font-size:10pt;font-family:Verdana;">To      wait on threads to complete, use the </span><i><span style="font-size:10pt;font-family:Verdana;">Thread      </span></i><span style="font-size:10pt;font-family:Verdana;">class’s </span><i><span style="font-size:10pt;font-family:Verdana;">Join </span></i><span style="font-size:10pt;font-family:Verdana;">method.</span></li>
<li class="MsoNormal"><span style="font-size:10pt;font-family:Verdana;">To      cancel execution of a thread, use the </span><i><span style="font-size:10pt;font-family:Verdana;">Thread      </span></i><span style="font-size:10pt;font-family:Verdana;">class’s </span><i><span style="font-size:10pt;font-family:Verdana;">Abort </span></i><span style="font-size:10pt;font-family:Verdana;">method.</span></li>
<li class="MsoNormal"><span style="font-size:10pt;font-family:Verdana;">To      share data across threads, use the </span><i><span style="font-size:10pt;font-family:Verdana;">ExecutionContext      </span></i><span style="font-size:10pt;font-family:Verdana;">class.</span></li>
<li class="MsoNormal"><span style="font-size:10pt;font-family:Verdana;">To      perform atomic math operations, use the </span><i><span style="font-size:10pt;font-family:Verdana;">Interlock      </span></i><span style="font-size:10pt;font-family:Verdana;">class.</span></li>
<li class="MsoNormal"><span style="font-size:10pt;font-family:Verdana;">To      lock data, use the C# </span><i><span style="font-size:10pt;font-family:Verdana;">lock </span></i><span style="font-size:10pt;font-family:Verdana;">or      the Visual Basic </span><i><span style="font-size:10pt;font-family:Verdana;">SyncLock </span></i><span style="font-size:10pt;font-family:Verdana;">syntax.</span></li>
<li class="MsoNormal"><span style="font-size:10pt;font-family:Verdana;">To      lock data with a synchronization object, use the </span><i><span style="font-size:10pt;font-family:Verdana;">Monitor      </span></i><span style="font-size:10pt;font-family:Verdana;">class.</span></li>
<li class="MsoNormal"><span style="font-size:10pt;font-family:Verdana;">To      lock data where multiple readers can access data at once but one writer at      a time can change data, use a </span><i><span style="font-size:10pt;font-family:Verdana;">ReaderWriterLock</span></i><span style="font-size:10pt;font-family:Verdana;">.</span></li>
<li class="MsoNormal"><span style="font-size:10pt;font-family:Verdana;">To      synchronize threads across AppDomains or process boundaries, use a </span><i><span style="font-size:10pt;font-family:Verdana;">Mutex</span></i><span style="font-size:10pt;font-family:Verdana;">.</span></li>
<li class="MsoNormal"><span style="font-size:10pt;font-family:Verdana;">To      throttle threads with a resource-based synchronization object, use a </span><i><span style="font-size:10pt;font-family:Verdana;">Semaphore</span></i><span style="font-size:10pt;font-family:Verdana;">.</span></li>
<li class="MsoNormal"><span style="font-size:10pt;font-family:Verdana;">To      signal threads across AppDomains or process boundaries, use an </span><i><span style="font-size:10pt;font-family:Verdana;">Event</span></i><span style="font-size:10pt;font-family:Verdana;">.</span></li>
<li class="MsoNormal"><span style="font-size:10pt;font-family:Verdana;">The </span><i><span style="font-size:10pt;font-family:Verdana;">Thread      </span></i><span style="font-size:10pt;font-family:Verdana;">class can be used to create multiple paths for      simultaneous execution in your own applications.</span></li>
<li class="MsoNormal"><span style="font-size:10pt;font-family:Verdana;">Using      the </span><i><span style="font-size:10pt;font-family:Verdana;">lock </span></i><span style="font-size:10pt;font-family:Verdana;">(</span><i><span style="font-size:10pt;font-family:Verdana;">SyncLock      </span></i><span style="font-size:10pt;font-family:Verdana;">in Visual Basic) keyword will allow you to write      threadsafe access to your code’s data.</span></li>
<li class="MsoNormal"><span style="font-size:10pt;font-family:Verdana;">You      must be careful in writing thread-safe code to avoid deadlock situations.</span></li>
<li class="MsoNormal"><span style="font-size:10pt;font-family:Verdana;">The </span><i><span style="font-size:10pt;font-family:Verdana;">ReaderWriterLock      </span></i><span style="font-size:10pt;font-family:Verdana;">class can be used to write thread-safe code that is      less prone to allowing only a single thread at a time to access its data.</span></li>
<li class="MsoNormal"><span style="font-size:10pt;font-family:Verdana;">The </span><i><span style="font-size:10pt;font-family:Verdana;">WaitHandle      </span></i><span style="font-size:10pt;font-family:Verdana;">derived classes (</span><i><span style="font-size:10pt;font-family:Verdana;">Mutex</span></i><span style="font-size:10pt;font-family:Verdana;">,      </span><i><span style="font-size:10pt;font-family:Verdana;">Semaphore</span></i><span style="font-size:10pt;font-family:Verdana;">, and      </span><i><span style="font-size:10pt;font-family:Verdana;">Event </span></i><span style="font-size:10pt;font-family:Verdana;">classes)      exemplify Windows operating-system-level synchronization objects.</span></li>
<li class="MsoNormal"><span style="font-size:10pt;font-family:Verdana;"><span> </span></span><span style="font-size:10pt;font-family:Verdana;">Much of the      .NET Framework supports the Asynchronous Programming Model (APM) to allow      for asynchronous execution of code without having to directly deal with      the </span><i><span style="font-size:10pt;font-family:Verdana;">ThreadPool </span></i><span style="font-size:10pt;font-family:Verdana;">or      </span><i><span style="font-size:10pt;font-family:Verdana;">Threads</span></i><span style="font-size:10pt;font-family:Verdana;">.</span></li>
<li class="MsoNormal"><span style="font-size:10pt;font-family:Verdana;">The </span><i><span style="font-size:10pt;font-family:Verdana;">ThreadPool      </span></i><span style="font-size:10pt;font-family:Verdana;">is a convenient class that enables fast creation of      threads for queuing up code to run as well as for waiting for </span><i><span style="font-size:10pt;font-family:Verdana;">WaitHandle      </span></i><span style="font-size:10pt;font-family:Verdana;">derived objects.</span></li>
<li class="MsoNormal"><i><span style="font-size:10pt;font-family:Verdana;">Timers      </span></i><span style="font-size:10pt;font-family:Verdana;">are useful objects for firing off code on separate      threads at specific intervals.</span></li>
</ol>
<p>Extracted from MCTS(70-536) Application Development Foundation</p>
<p class="MsoNormal" style="margin-left:0.25in;"><span style="font-size:10pt;font-family:Verdana;"> </span></p>
<p class="MsoNormal" style="margin-left:0.25in;"><span style="font-size:10pt;font-family:Verdana;"> </span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:Verdana;"> </span></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/mcts2005.wordpress.com/14/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/mcts2005.wordpress.com/14/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mcts2005.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mcts2005.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mcts2005.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mcts2005.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mcts2005.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mcts2005.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mcts2005.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mcts2005.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mcts2005.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mcts2005.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mcts2005.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mcts2005.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mcts2005.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mcts2005.wordpress.com/14/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mcts2005.wordpress.com&amp;blog=2471586&amp;post=14&amp;subd=mcts2005&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mcts2005.wordpress.com/2008/01/30/some-key-points-to-remember-on-threading/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f6057d1a047efaf99b52299c302149f8?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">piyusht</media:title>
		</media:content>
	</item>
		<item>
		<title>Quick Walkthrough of Collections and Genrics</title>
		<link>http://mcts2005.wordpress.com/2008/01/23/quick-walkthrough-of-collections-and-genrics/</link>
		<comments>http://mcts2005.wordpress.com/2008/01/23/quick-walkthrough-of-collections-and-genrics/#comments</comments>
		<pubDate>Wed, 23 Jan 2008 13:38:13 +0000</pubDate>
		<dc:creator>piyusht</dc:creator>
				<category><![CDATA[C# MCTS]]></category>

		<guid isPermaLink="false">http://mcts2005.wordpress.com/2008/01/23/quick-walkthrough-of-collections-and-genrics/</guid>
		<description><![CDATA[The .NET Framework supports a variety of collection classes that can be used in different circumstances. Here are some points that give a quick summary of Collections and Genrics in framework 2.0 Basics The ArrayList is a simple collection of unordered items. The Add and AddRange methods of the ArrayList are used to add items [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mcts2005.wordpress.com&amp;blog=2471586&amp;post=13&amp;subd=mcts2005&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><b><br />
</b></p>
<p>The .NET Framework supports a variety of collection classes that can be used in different circumstances. Here are some points that give a quick summary of Collections and Genrics in framework 2.0</p>
<p><b>Basics</b></p>
<ol>
<li>The ArrayList is a simple collection of unordered items.</li>
<li>The Add and AddRange methods of the ArrayList are used to add items to an ArrayList.</li>
<li>The Insert and InsertRange methods of the ArrayList are used to insert items into specific places in a collection.</li>
<li>The Remove, RemoveAt, and RemoveRange methods of the ArrayList are used to delete items from a collection.</li>
<li>The indexer of the ArrayList can be used to iterate over a collection.</li>
<li>The IEnumerable and IEnumerator interfaces can be used to enumerate through a collection as well.</li>
<li>The foreach construct in Visual Basic and C# use the IEnumerable interface to concisely iterate over a collection.</li>
</ol>
<p><b>Sequential Lists</b></p>
<ol>
<li>The .NET Framework supports the Queue and Stack classes to provide collections that represent sequential lists of items.</li>
<li>The Queue is a first-in, first-out (FIFO) collection.</li>
<li>The Queue class supports the Enqueue and Dequeue methods for adding and removing items from the collection.</li>
<li> The Stack is a last-in, first-out (LIFO) collection.</li>
<li>The Stack class supports the Push and Pop methods for adding and removing items, respectively, from the collection.</li>
<li>Both sequential collection classes support Peek for viewing the next item in the collection without removing it.</li>
</ol>
<p><b>Dictionaries</b></p>
<ol>
<li>The IDictionary interface provides the basic calling convention for all Dictionary collections.</li>
<li>The Hashtable class can be used to create lookup tables.</li>
<li>You can use a DictionaryEntry object to get at the key and value of an object in a Dictionary collection.</li>
<li>The SortedList can be used to create list of items that can be sorted by a key.</li>
<li>The IEqualityComparer can be used to construct hash values and compare values for classes in an arbitrary way.</li>
</ol>
<p><b></b><b></b></p>
<p><b> Specialized Collections</b></p>
<ol>
<li>The BitArray class and the BitVector32 structure can both be used to perform bit-wise operations on a series of Boolean values.</li>
<li>The StringCollection and StringDictionary classes are type-safe classes for storing strings.</li>
<li>You can create case-insensitive versions of Hashtable and SortedList objects using the CollectionUtil class.</li>
<li>NameValueCollection is a useful class for storing more than one value per key in a name/value collection.</li>
</ol>
<p><b>Generic Collections</b></p>
<ol>
<li>Generic collections can be used to create more type-safe and potentially faster versions of their nongeneric counterparts.</li>
<li>The generic List, Dictionary, Queue, Stack, SortedList, and SortedDictionary classes are type-safe versions of the collections.</li>
<li>The new LinkedList generic class is a collection for storing items that know about their own relationship in the list, and it allows for iteration without having access to the collection itself.</li>
</ol>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/mcts2005.wordpress.com/13/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/mcts2005.wordpress.com/13/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mcts2005.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mcts2005.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mcts2005.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mcts2005.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mcts2005.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mcts2005.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mcts2005.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mcts2005.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mcts2005.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mcts2005.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mcts2005.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mcts2005.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mcts2005.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mcts2005.wordpress.com/13/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mcts2005.wordpress.com&amp;blog=2471586&amp;post=13&amp;subd=mcts2005&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mcts2005.wordpress.com/2008/01/23/quick-walkthrough-of-collections-and-genrics/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f6057d1a047efaf99b52299c302149f8?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">piyusht</media:title>
		</media:content>
	</item>
		<item>
		<title>Combine Delegates (Multicast Delegates)</title>
		<link>http://mcts2005.wordpress.com/2008/01/21/combine-delegates-multicast-delegates/</link>
		<comments>http://mcts2005.wordpress.com/2008/01/21/combine-delegates-multicast-delegates/#comments</comments>
		<pubDate>Mon, 21 Jan 2008 11:47:25 +0000</pubDate>
		<dc:creator>piyusht</dc:creator>
				<category><![CDATA[C# What I learned Today !]]></category>

		<guid isPermaLink="false">http://mcts2005.wordpress.com/2008/01/21/combine-delegates-multicast-delegates/</guid>
		<description><![CDATA[This example demonstrates how to compose multicast delegates. A useful property of delegate objects is that they can be assigned to one delegate instance to be multicast using the + operator. A composed delegate calls the two delegates it was composed from. Only delegates of the same type can be composed. &#160; The - operator [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mcts2005.wordpress.com&amp;blog=2471586&amp;post=12&amp;subd=mcts2005&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p class="MsoNormal">This example demonstrates how to compose multicast delegates. A useful property of delegate objects is that they can be assigned to one delegate instance to be<b> multicast using the <span class="keyword">+</span> operator</b>. A composed delegate calls the two delegates it was composed from. <b>Only delegates of the same type can be composed.</b></p>
<p class="MsoNormal">&nbsp;</p>
<p class="MsoNormal"><b>The <span class="keyword">-</span> operator can be used to remove a component delegate from a composed delegate.</b></p>
<p class="MsoNormal">&nbsp;</p>
<p class="MsoNormal"><b>Example</b></p>
<pre>delegate <span style="color:blue;">void</span> Del(<span style="color:blue;">string</span> s);

<span style="color:blue;">class</span> TestClass
{
    <span style="color:blue;">static</span> <span style="color:blue;">void</span> Hello(<span style="color:blue;">string</span> s)
    {
        System.Console.WriteLine(<span style="color:maroon;">"  Hello, {0}!"</span>, s);
    }

    <span style="color:blue;">static</span> <span style="color:blue;">void</span> Goodbye(<span style="color:blue;">string</span> s)
    {
        System.Console.WriteLine(<span style="color:maroon;">"  Goodbye, {0}!"</span>, s);
    }

    <span style="color:blue;">static</span> <span style="color:blue;">void</span> Main()
    {
        Del a, b, c, d;

        <span style="color:green;">// Create the delegate object a that references </span>
        <span style="color:green;">// the method Hello:</span>
        a = Hello;

        <span style="color:green;">// Create the delegate object b that references </span>
        <span style="color:green;">// the method Goodbye:</span>
        b = Goodbye;

        <span style="color:green;">// The two delegates, a and b, are composed to form c: </span>
        c = a + b;

        <span style="color:green;">// Remove a from the composed delegate, leaving d, </span>
        <span style="color:green;">// which calls only the method Goodbye:</span>
        d = c - a;

        System.Console.WriteLine(<span style="color:maroon;">"Invoking delegate a:"</span>);
        a(<span style="color:maroon;">"A"</span>);
        System.Console.WriteLine(<span style="color:maroon;">"Invoking delegate b:"</span>);
        b(<span style="color:maroon;">"B"</span>);
        System.Console.WriteLine(<span style="color:maroon;">"Invoking delegate c:"</span>);
        c(<span style="color:maroon;">"C"</span>);
        System.Console.WriteLine(<span style="color:maroon;">"Invoking delegate d:"</span>);
        d(<span style="color:maroon;">"D"</span>);
    }
}</pre>
<p class="MsoNormal"><b>Output</b></p>
<pre>Invoking delegate a:
  Hello, A!
Invoking delegate b:
  Goodbye, B!
Invoking delegate c:
  Hello, C!
  Goodbye, C!
Invoking delegate d:
  Goodbye, D!</pre>
<p class="MsoNormal">Extracted from MSDN articles</p>
<p class="MsoNormal">&nbsp;</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/mcts2005.wordpress.com/12/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/mcts2005.wordpress.com/12/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mcts2005.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mcts2005.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mcts2005.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mcts2005.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mcts2005.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mcts2005.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mcts2005.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mcts2005.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mcts2005.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mcts2005.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mcts2005.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mcts2005.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mcts2005.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mcts2005.wordpress.com/12/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mcts2005.wordpress.com&amp;blog=2471586&amp;post=12&amp;subd=mcts2005&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mcts2005.wordpress.com/2008/01/21/combine-delegates-multicast-delegates/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f6057d1a047efaf99b52299c302149f8?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">piyusht</media:title>
		</media:content>
	</item>
		<item>
		<title>When to Use Delegates Instead of Interfaces</title>
		<link>http://mcts2005.wordpress.com/2008/01/21/when-to-use-delegates-instead-of-interfaces/</link>
		<comments>http://mcts2005.wordpress.com/2008/01/21/when-to-use-delegates-instead-of-interfaces/#comments</comments>
		<pubDate>Mon, 21 Jan 2008 11:20:04 +0000</pubDate>
		<dc:creator>piyusht</dc:creator>
				<category><![CDATA[C# What I learned Today !]]></category>

		<guid isPermaLink="false">http://mcts2005.wordpress.com/2008/01/21/when-to-use-delegates-instead-of-interfaces/</guid>
		<description><![CDATA[Both delegates and interfaces enable a class designer to separate type declarations and implementation. A given interface can be inherited and implemented by any class or struct. A delegate can be created for a method on any class, as long as the method fits the method signature for the delegate. An interface reference or a [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mcts2005.wordpress.com&amp;blog=2471586&amp;post=11&amp;subd=mcts2005&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div class="introduction">Both delegates and interfaces enable a class designer to separate type declarations and implementation. A given interface can be inherited and implemented by any class or struct. A delegate can be created for a method on any class, as long as the method fits the method signature for the delegate. An interface reference or a delegate can be used by an object that has no knowledge of the class that implements the interface or delegate method. Given these similarities, when should a class designer use a delegate and when should it use an interface?</div>
<div class="introduction"></div>
<div class="introduction"><b>Use a delegate in the following circumstances:</b></div>
<div class="introduction">
<ul>
<li>An eventing design pattern is used.</li>
<li>It is desirable to encapsulate a static method.</li>
<li>The caller has no need to access other properties, methods, or interfaces on the object implementing the method.</li>
<li>Easy composition is desired.</li>
<li>A class may need more than one implementation of the method.</li>
</ul>
<p><b>Use an interface in the following circumstances:</b></p>
<ul>
<li>There is a group of related methods that may be called.</li>
<li>A class only needs one implementation of the method.</li>
<li>The class using the interface will want to cast that interface to other interface or class types.</li>
<li>The method being implemented is linked to the type or identity of the class: for example, comparison methods.</li>
</ul>
<p>One good example of using a single-method interface instead of a delegate is IComparable or the generic version, IComparable<span class="cs"></span><span class="vb"></span><span class="cpp"></span><span class="nu">(</span>T<span class="cs"></span><span class="vb">)</span><span class="cpp"></span>. <b>IComparable</b> declares the CompareTo method, which returns an integer that specifies a less than, equal to, or greater than relationship between two objects of the same type. <b>IComparable</b> can be used as the basis of a sort algorithm. Although using a delegate comparison method as the basis of a sort algorithm would be valid, it is not ideal. Because the ability to compare belongs to the class and the comparison algorithm does not change at run time, a single-method interface is ideal.</p>
<p>Extracted from Microsoft Technet articles.</p></div>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/mcts2005.wordpress.com/11/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/mcts2005.wordpress.com/11/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mcts2005.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mcts2005.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mcts2005.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mcts2005.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mcts2005.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mcts2005.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mcts2005.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mcts2005.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mcts2005.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mcts2005.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mcts2005.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mcts2005.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mcts2005.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mcts2005.wordpress.com/11/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mcts2005.wordpress.com&amp;blog=2471586&amp;post=11&amp;subd=mcts2005&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mcts2005.wordpress.com/2008/01/21/when-to-use-delegates-instead-of-interfaces/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/f6057d1a047efaf99b52299c302149f8?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">piyusht</media:title>
		</media:content>
	</item>
		<item>
		<title>SQL Bulk copy</title>
		<link>http://mcts2005.wordpress.com/2008/01/14/sql-bulk-copy/</link>
		<comments>http://mcts2005.wordpress.com/2008/01/14/sql-bulk-copy/#comments</comments>
		<pubDate>Mon, 14 Jan 2008 10:13:06 +0000</pubDate>
		<dc:creator>Mayur Kotlikar</dc:creator>
				<category><![CDATA[C# What I learned Today !]]></category>
		<category><![CDATA[526]]></category>
		<category><![CDATA[bulk copy]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[mcts]]></category>
		<category><![CDATA[SqlBulkCopy]]></category>

		<guid isPermaLink="false">http://mcts2005.wordpress.com/2008/01/14/sql-bulk-copy/</guid>
		<description><![CDATA[Very straightforward with C# .Net 2005 ! The important class is &#8220;SqlBulkCopy&#8221;. &#8220;SqlBulkCopy&#8221; is very helpful in coping the contents of one database table to other. I ensured that the design of the table is same. I used Customers table of Northwind database (created a copy of it named CustomersHistory) and my both DesitnationConnection and [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mcts2005.wordpress.com&amp;blog=2471586&amp;post=10&amp;subd=mcts2005&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Very straightforward with C# .Net 2005 !</p>
<p>The important class is &#8220;SqlBulkCopy&#8221;.</p>
<p>&#8220;SqlBulkCopy&#8221; is very helpful in coping the contents of one database table to other.</p>
<p>I ensured that the design of the table is same. I used Customers table of Northwind database (created a copy of it named CustomersHistory) and my both DesitnationConnection and SourceConnection points to same database.</p>
<p>Few lines below is all that is needed:</p>
<p>// SourceConnection and DestinationConnection are a SqlConnection pointing to Northwind database</p>
<p>// Data  from Customers table is bulk-copied to CustomersHistory</p>
<p>SqlCommand GetCustomerCommand = new SqlCommand(&#8220;SELECT * FROM Customers&#8221;,SourceConnection);<br />
SourceConnection.Open();<br />
SqlDataReader CustomerReader = GetCustomerCommand.ExecuteReader();<br />
SqlBulkCopy CustomerBulkCopy = new SqlBulkCopy(DestinationConnection);<br />
DestinationConnection.Open();<br />
CustomerBulkCopy.DestinationTableName = &#8220;CustomerHistory&#8221;;<br />
CustomerBulkCopy.WriteToServer(CustomerReader);<br />
CustomerReader.Close();<br />
DestinationConnection.Close();<br />
SourceConnection.Close();</p>
<p>// This code is taken from MCTS Self Paces Training Kit 526, with few changes</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/mcts2005.wordpress.com/10/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/mcts2005.wordpress.com/10/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mcts2005.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mcts2005.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mcts2005.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mcts2005.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mcts2005.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mcts2005.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mcts2005.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mcts2005.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mcts2005.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mcts2005.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mcts2005.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mcts2005.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mcts2005.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mcts2005.wordpress.com/10/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mcts2005.wordpress.com&amp;blog=2471586&amp;post=10&amp;subd=mcts2005&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mcts2005.wordpress.com/2008/01/14/sql-bulk-copy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/567cf68949cef0b0740564e0599aaeee?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Mayur Kotlikar</media:title>
		</media:content>
	</item>
		<item>
		<title>Folder Browser Dialog</title>
		<link>http://mcts2005.wordpress.com/2008/01/14/folder-browser-dialog/</link>
		<comments>http://mcts2005.wordpress.com/2008/01/14/folder-browser-dialog/#comments</comments>
		<pubDate>Mon, 14 Jan 2008 09:39:27 +0000</pubDate>
		<dc:creator>Mayur Kotlikar</dc:creator>
				<category><![CDATA[C# What I learned Today !]]></category>
		<category><![CDATA[browse folder]]></category>
		<category><![CDATA[C#ShowDialog()]]></category>
		<category><![CDATA[FolderBrowserDialog]]></category>

		<guid isPermaLink="false">http://mcts2005.wordpress.com/2008/01/14/folder-browser-dialog/</guid>
		<description><![CDATA[Many time, it is necessary to show a folder browser dialog. Typically this is useful in an GUI based application where the applications wants the user to choose a folder. I came across FolderBrowserDialog. FolderBrowserDialog SavePathDialog = new FolderBrowserDialog(); SavePathDialog.Description = "Select a folder to restore BLOB to"; SavePathDialog.ShowDialog(); String SavePath = SavePathDialog.SelectedPath;<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mcts2005.wordpress.com&amp;blog=2471586&amp;post=9&amp;subd=mcts2005&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Many time, it is necessary to show a folder browser dialog.</p>
<p>Typically this is useful in an GUI based application where the applications wants the user to choose a folder.</p>
<p>I came across FolderBrowserDialog.<br />
<code><br />
            FolderBrowserDialog SavePathDialog = new FolderBrowserDialog();<br />
            SavePathDialog.Description = "Select a folder to restore BLOB to";<br />
            SavePathDialog.ShowDialog();<br />
            String SavePath = SavePathDialog.SelectedPath;<br />
</code></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/mcts2005.wordpress.com/9/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/mcts2005.wordpress.com/9/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mcts2005.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mcts2005.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mcts2005.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mcts2005.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mcts2005.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mcts2005.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mcts2005.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mcts2005.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mcts2005.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mcts2005.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mcts2005.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mcts2005.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mcts2005.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mcts2005.wordpress.com/9/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mcts2005.wordpress.com&amp;blog=2471586&amp;post=9&amp;subd=mcts2005&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mcts2005.wordpress.com/2008/01/14/folder-browser-dialog/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/567cf68949cef0b0740564e0599aaeee?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Mayur Kotlikar</media:title>
		</media:content>
	</item>
		<item>
		<title>MCTS(70-526) Windows-Based Client Development &#8211; Chapter 6 Summary</title>
		<link>http://mcts2005.wordpress.com/2008/01/11/mcts70-526-windows-based-client-development-chapter-6-summary/</link>
		<comments>http://mcts2005.wordpress.com/2008/01/11/mcts70-526-windows-based-client-development-chapter-6-summary/#comments</comments>
		<pubDate>Fri, 11 Jan 2008 12:43:52 +0000</pubDate>
		<dc:creator>Mayur Kotlikar</dc:creator>
				<category><![CDATA[C# MCTS]]></category>
		<category><![CDATA[ADO.Net]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[Command]]></category>
		<category><![CDATA[mcts]]></category>
		<category><![CDATA[Parameter]]></category>
		<category><![CDATA[SqlCommand]]></category>
		<category><![CDATA[SqlParameter]]></category>

		<guid isPermaLink="false">http://mcts2005.wordpress.com/2008/01/11/mcts70-526-windows-based-client-development-chapter-6-summary/</guid>
		<description><![CDATA[Chapter 6 Working with Data in a Connected environment What Are Command Objects? To execute SQL statements and stored procedures against a database (from your application), you use Command objects. Command objects contain the necessary information to execute SQL statements, stored procedures, functions, and so on against a data source; return data to your application; [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mcts2005.wordpress.com&amp;blog=2471586&amp;post=8&amp;subd=mcts2005&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p class="MsoNormal"><b><u><span style="font-size:10pt;font-family:Arial;">Chapter 6</span></u></b></p>
<p class="MsoNormal"><b><u><span style="font-size:10pt;font-family:Arial;">Working with Data in a Connected environment</span></u></b></p>
<p class="MsoNormal"><span style="font-family:'IBEHF F+ Segoe';color:black;"> </span></p>
<p class="MsoNormal"><b><span style="font-size:10pt;font-family:Arial;">What Are Command Objects? </span></b></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:Arial;color:black;">To execute SQL statements and stored procedures against a database (from your application), you use Command objects. Command objects contain the necessary information to execute SQL statements, stored procedures, functions, and so on against a data source; return data to your application; and perform database catalog operations such as creating, altering, and deleting database objects. In other words, you can use Command objects to execute any valid SQL statement. </span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:Arial;color:black;"> </span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:Arial;color:black;">Just like Connection objects, there are Command objects for each of the .NET Framework Data Providers. Select the specific Command object that coincides with the .NET Framework Data Provider being used to communicate with your data source. </span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:Arial;color:black;"> </span></p>
<p class="MsoNormal"><b><i><span style="font-size:10pt;font-family:Arial;color:black;">The primary properties of a Command object are the CommandText, CommandType, and Connection properties. </span></i></b></p>
<p class="MsoNormal"><b><i><span style="font-size:10pt;font-family:Arial;color:black;"> </span></i></b></p>
<p class="MsoNormal"><b><i><span style="font-size:10pt;font-family:Arial;color:black;"><span> </span></span></i></b></p>
<p class="MsoNormal" style="text-align:center;" align="center"><b><i><span style="font-size:10pt;font-family:Arial;color:black;">Common Command Object Methods</span></i></b></p>
<p class="MsoNormal"><b><i><span style="font-size:10pt;font-family:Arial;color:black;"> </span></i></b></p>
<div align="center">
<table class="MsoTableTheme" style="border:medium none;width:376.9pt;border-collapse:collapse;" border="1" cellpadding="0" cellspacing="0" width="503">
<tr style="height:15.75pt;">
<td style="border:1pt solid windowtext;width:92.4pt;height:15.75pt;padding:0 5.4pt;" valign="top" width="123">
<p class="MsoNormal"><span style="font-size:9pt;font-family:Arial;">Cancel </span></p>
</td>
<td style="width:284.5pt;height:15.75pt;border-color:windowtext windowtext windowtext #000000;border-style:solid solid solid none;border-width:1pt 1pt 1pt medium;padding:0 5.4pt;" valign="top" width="379">
<p class="MsoNormal"><span style="font-size:9pt;font-family:Arial;">Tries to   cancel the execution of the command. </span></p>
</td>
</tr>
<tr style="height:35pt;">
<td style="width:92.4pt;height:35pt;border-color:#000000 windowtext windowtext;border-style:none solid solid;border-width:medium 1pt 1pt;padding:0 5.4pt;" valign="top" width="123">
<p class="MsoNormal"><span style="font-size:9pt;font-family:Arial;">ExecuteNonQuery   </span></p>
</td>
<td style="width:284.5pt;height:35pt;border-color:rgb(0,;border-style:none solid solid none;border-width:medium 1pt 1pt medium;padding:0 5.4pt;" valign="top" width="379">
<p class="MsoNormal"><span style="font-size:9pt;font-family:Arial;">Executes   SQL statements or stored procedures that do <b>not</b> return data. </span></p>
</td>
</tr>
<tr style="height:21pt;">
<td style="width:92.4pt;height:21pt;border-color:#000000 windowtext windowtext;border-style:none solid solid;border-width:medium 1pt 1pt;padding:0 5.4pt;" valign="top" width="123">
<p class="MsoNormal"><span style="font-size:9pt;font-family:Arial;">ExecuteReader   </span></p>
</td>
<td style="width:284.5pt;height:21pt;border-color:rgb(0,;border-style:none solid solid none;border-width:medium 1pt 1pt medium;padding:0 5.4pt;" valign="top" width="379">
<p class="MsoNormal"><span style="font-size:9pt;font-family:Arial;">Executes   commands that return tabular (or rows) of data. </span></p>
</td>
</tr>
<tr style="height:49.9pt;">
<td style="width:92.4pt;height:49.9pt;border-color:#000000 windowtext windowtext;border-style:none solid solid;border-width:medium 1pt 1pt;padding:0 5.4pt;" valign="top" width="123">
<p class="MsoNormal"><span style="font-size:9pt;font-family:Arial;">ExecuteScalar   </span></p>
</td>
<td style="width:284.5pt;height:49.9pt;border-color:rgb(0,;border-style:none solid solid none;border-width:medium 1pt 1pt medium;padding:0 5.4pt;" valign="top" width="379">
<p class="MsoNormal"><span style="font-size:9pt;font-family:Arial;">Executes   SQL statements or stored procedures that return a single value. If you call   ExecuteScalar with a statement that returns rows of data, the query executes   but returns only the first column of the first row returned by the query.   Additional columns or rows are ignored. </span></p>
</td>
</tr>
<tr style="height:29.9pt;">
<td style="width:92.4pt;height:29.9pt;border-color:#000000 windowtext windowtext;border-style:none solid solid;border-width:medium 1pt 1pt;padding:0 5.4pt;" valign="top" width="123">
<p class="MsoNormal"><span style="font-size:9pt;font-family:Arial;">ExecuteXMLReader   </span></p>
</td>
<td style="width:284.5pt;height:29.9pt;border-color:rgb(0,;border-style:none solid solid none;border-width:medium 1pt 1pt medium;padding:0 5.4pt;" valign="top" width="379">
<p class="MsoNormal"><span style="font-size:9pt;font-family:Arial;">Returns   XML formatted data. Returns a System.Xml.XmlReader object. </span></p>
</td>
</tr>
</table>
</div>
<p class="MsoNormal"><span style="font-family:'IBDEI I+ Berkeley Old ITC';"> </span></p>
<p class="MsoNormal"><span style="font-family:'IBEHF F+ Segoe';color:black;"> </span></p>
<p class="MsoNormal"><b><span style="font-size:10pt;font-family:Arial;">Creating and Configuring Command Objects </span></b></p>
<p class="MsoNormal" style="margin-bottom:11.25pt;line-height:14pt;"><span style="font-size:10pt;font-family:Arial;color:black;">Create Command objects by declaring an instance of the desired Command object and setting the CommandType and CommandText properties. To execute the command, you must also set the command’s Connection property to a valid Connection object. </span></p>
<p class="MsoNormal"><b><span style="font-size:10pt;font-family:Arial;">Creating a Command Object That Executes a SQL Statement </span></b></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:Arial;">To execute commands that run SQL statements against a database, set the <i>CommandType property to Text<b> </b></i>and set the <i>CommandText property to the SQL statement</i> you want to execute. </span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:Arial;"> </span></p>
<p class="MsoNormal"><span style="font-size:9pt;font-family:Arial;">SqlCommand CustomersCommand = new SqlCommand(); </span></p>
<p class="MsoNormal"><span style="font-size:9pt;font-family:Arial;">CustomersCommand.Connection = NorthwindConnection;</span></p>
<p class="MsoNormal"><span style="font-size:9pt;font-family:Arial;">CustomersCommand.CommandType = CommandType.Text; </span></p>
<p class="MsoNormal"><span style="font-size:9pt;font-family:Arial;">CustomersCommand.CommandText = &#8220;SELECT CustomerID, CompanyName FROM Customers&#8221;;</span></p>
<p class="MsoNormal" style="margin-bottom:19.65pt;text-align:justify;line-height:14pt;"><span style="font-size:10pt;font-family:Arial;color:black;"> </span></p>
<p class="MsoNormal" style="margin-bottom:19.65pt;text-align:justify;line-height:14pt;"><span style="font-size:10pt;font-family:Arial;color:black;"> </span></p>
<p class="MsoNormal"><span style="font-family:'IBEHF F+ Segoe';color:black;"> </span></p>
<p class="MsoNormal"><b><span style="font-size:10pt;font-family:Arial;">Creating a Command Object That Executes a Stored Procedure </span></b></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:Arial;">To execute commands that run existing stored procedures in a database, set the <i>CommandType property to StoredProcedure</i> and set the <i>CommandText property to the name of the stored procedure</i> you want to execute. </span></p>
<p class="MsoNormal"><span style="font-size:9pt;font-family:Arial;"> </span></p>
<p class="MsoNormal"><span style="font-size:9pt;font-family:Arial;">SqlCommand TopTenCommand = new SqlCommand(); </span></p>
<p class="MsoNormal"><span style="font-size:9pt;font-family:Arial;">TopTenCommand.Connection = NorthwindConnection; </span></p>
<p class="MsoNormal"><span style="font-size:9pt;font-family:Arial;">TopTenCommand.CommandType = CommandType.StoredProcedure;</span></p>
<p class="MsoNormal"><span style="font-size:9pt;font-family:Arial;">TopTenCommand.CommandText = &#8220;Ten Most Expensive Products&#8221;; </span></p>
<p class="MsoNormal"><span style="font-family:'IBEHF F+ Segoe';color:black;"> </span></p>
<p class="MsoNormal"><b><span style="font-size:10pt;font-family:Arial;">Creating a Command Object That Performs Catalog Operations </span></b></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:Arial;">To execute commands that run DML actions (Data Manipulation Language), create commands that run SQL statements and call <i>the ExecuteNonQuery</i> method of the command. </span></p>
<p class="MsoNormal"><span style="font-size:9pt;font-family:Arial;"> </span></p>
<p class="MsoNormal"><span style="font-size:9pt;font-family:Arial;"> </span></p>
<p class="MsoNormal"><span style="font-size:9pt;font-family:Arial;">SqlCommand CreateTableCommand = new SqlCommand(); </span></p>
<p class="MsoNormal"><span style="font-size:9pt;font-family:Arial;">CreateTableCommand.Connection = NorthwindConnection;</span></p>
<p class="MsoNormal"><span style="font-size:9pt;font-family:Arial;"><span> </span>CreateTableCommand.CommandType = CommandType.Text;</span></p>
<p class="MsoNormal"><span style="font-size:9pt;font-family:Arial;">CreateTableCommand.CommandText = &#8220;CREATE TABLE SalesPersons (&#8221; + </span></p>
<p class="MsoNormal" style="text-indent:0.5in;"><span style="font-size:9pt;font-family:Arial;">&#8220;[SalesPersonID] [int] IDENTITY(1,1) NOT NULL, &#8221; + </span></p>
<p class="MsoNormal" style="text-indent:0.5in;"><span style="font-size:9pt;font-family:Arial;">&#8220;[FirstName] [nvarchar](50) NULL, &#8221; + </span></p>
<p class="MsoNormal" style="text-indent:0.5in;"><span style="font-size:9pt;font-family:Arial;">&#8220;[LastName] [nvarchar](50) NULL)&#8221;; </span></p>
<p class="MsoNormal"><i><span style="font-size:10pt;font-family:Arial;">// ExecuteNonQuery to be done later</span></i></p>
<p class="MsoNormal"><span style="font-family:'IBEHF F+ Segoe';color:black;"> </span></p>
<p class="MsoNormal"><b><span style="font-size:10pt;font-family:Arial;">Creating a Command Object That Returns a Single Value </span></b></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:Arial;">To execute commands that return single values (scalar values), create commands that run SQL statements or stored procedures that return a single value (as opposed to commands that return rows or tabular data). Set the CommandText property to a SQL statement or stored procedure that returns a single value and <i>call the </i>ExecuteScalar method of the command. Declare a variable with the data type of the single value being returned from the database and cast the results of the ExecuteScalar call to the expected data type<i>. (<b>The ExecuteScalar method returns an Object, so you must cast the ExecuteScalar method to the equivalent of the returned data type</b>.) </i></span></p>
<p class="MsoNormal"><span style="font-family:'IALFOF+LucidaSansTypewriter,Bol';color:black;"> </span></p>
<p class="MsoNormal"><span style="font-size:9pt;font-family:Arial;">// C#</span></p>
<p class="MsoNormal"><span style="font-size:9pt;font-family:Arial;">SqlCommand ExecuteScalarCommand = new SqlCommand();</span></p>
<p class="MsoNormal"><span style="font-size:9pt;font-family:Arial;">ExecuteScalarCommand.Connection = NorthwindConnection;</span></p>
<p class="MsoNormal"><span style="font-size:9pt;font-family:Arial;">ExecuteScalarCommand.CommandType = CommandType.Text; </span></p>
<p class="MsoNormal"><span style="font-size:9pt;font-family:Arial;">ExecuteScalarCommand.CommandText = &#8220;SELECT Count(*) FROM Customers&#8221;; </span></p>
<p class="MsoNormal"><span style="font-size:9pt;font-family:Arial;">// Open the connection and execute the command</span></p>
<p class="MsoNormal"><span style="font-size:9pt;font-family:Arial;">ExecuteScalarCommand.Connection.Open(); </span></p>
<p class="MsoNormal"><span style="font-size:9pt;font-family:Arial;">int CustomerCount = (int)ExecuteScalarCommand.ExecuteScalar();</span></p>
<p class="MsoNormal"><span style="font-size:9pt;font-family:Arial;">MessageBox.Show(&#8220;There are &#8221; + CustomerCount.ToString() + &#8221; customers&#8221;); ExecuteScalarCommand.Connection.Close();</span></p>
<p class="MsoNormal"><span style="font-family:'IBEHF F+ Segoe';color:black;"> </span></p>
<p class="MsoNormal"><b><span style="font-size:10pt;font-family:Arial;">Executing Commands Asynchronously </span></b></p>
<p class="MsoNormal" style="margin-bottom:5.25pt;text-align:justify;line-height:14pt;"><span style="font-size:10pt;font-family:Arial;">Executing commands asynchronously is the process of having the command execute on a <i>separate thread</i> from the rest of your application so users do not have to wait for the command to complete before continuing work in other parts of the application. </span></p>
<p class="MsoNormal" style="margin:0 0 8.15pt 42pt;"><span style="font-size:10pt;font-family:'IBEHF F+ Segoe';color:black;"> </span></p>
<p class="MsoNormal" style="margin:0 0 8.15pt 42pt;"><span style="font-size:10pt;font-family:'IBEHF F+ Segoe';color:black;"> </span></p>
<p class="MsoNormal" style="margin:0 0 8.15pt 42pt;"><span style="font-size:10pt;font-family:'IBEHF F+ Segoe';color:black;"> </span></p>
<p class="MsoNormal" style="margin:0 0 8.15pt 42pt;"><span style="font-size:10pt;font-family:'IBEHF F+ Segoe';color:black;"> </span></p>
<p class="MsoNormal" style="margin:0 0 8.15pt 42pt;"><span style="font-size:10pt;font-family:'IBEHF F+ Segoe';color:black;"> </span></p>
<p class="MsoNormal" style="margin:0 0 8.15pt 42pt;"><span style="font-size:10pt;font-family:'IBEHF F+ Segoe';color:black;"> </span></p>
<div align="center">
<table class="MsoTableProfessional" style="border:medium none;width:376.4pt;border-collapse:collapse;" border="1" cellpadding="0" cellspacing="0" width="502">
<tr style="height:29.9pt;">
<td style="border:1pt solid black;width:120.75pt;height:29.9pt;padding:0 5.4pt;" valign="top" width="161">
<p class="MsoNormal"><span style="font-size:10pt;font-family:Arial;">BeginExecuteNonQuery</span></p>
</td>
<td style="width:255.65pt;height:29.9pt;border-color:black black black #000000;border-style:solid solid solid none;border-width:1pt 1pt 1pt medium;padding:0 5.4pt;" valign="top" width="341">
<p class="MsoNormal"><span style="font-size:10pt;font-family:Arial;">Starts   the asynchronousl version of ExecuteNonQuery</span></p>
</td>
</tr>
<tr style="height:29.9pt;">
<td style="width:120.75pt;height:29.9pt;border-color:#000000 black black;border-style:none solid solid;border-width:medium 1pt 1pt;padding:0 5.4pt;" valign="top" width="161">
<p class="MsoNormal"><span style="font-size:10pt;font-family:Arial;">BeginExecuteReader   </span></p>
</td>
<td style="width:255.65pt;height:29.9pt;border-color:rgb(0,;border-style:none solid solid none;border-width:medium 1pt 1pt medium;padding:0 5.4pt;" valign="top" width="341">
<p class="MsoNormal"><span style="font-size:10pt;font-family:Arial;">Starts   the asynchronous version of the ExecuteReader method. </span></p>
</td>
</tr>
<tr style="height:34.9pt;">
<td style="width:120.75pt;height:34.9pt;border-color:#000000 black black;border-style:none solid solid;border-width:medium 1pt 1pt;padding:0 5.4pt;" valign="top" width="161">
<p class="MsoNormal"><span style="font-size:10pt;font-family:Arial;">BeginExecuteXmlReader   </span></p>
</td>
<td style="width:255.65pt;height:34.9pt;border-color:rgb(0,;border-style:none solid solid none;border-width:medium 1pt 1pt medium;padding:0 5.4pt;" valign="top" width="341">
<p class="MsoNormal"><span style="font-size:10pt;font-family:Arial;">Starts   the asynchronous version of the ExecuteXmlReader method. </span></p>
</td>
</tr>
<tr style="height:35pt;">
<td style="width:120.75pt;height:35pt;border-color:#000000 black black;border-style:none solid solid;border-width:medium 1pt 1pt;padding:0 5.4pt;" valign="top" width="161">
<p class="MsoNormal"><span style="font-size:10pt;font-family:Arial;">EndExecuteNonQuery   </span></p>
</td>
<td style="width:255.65pt;height:35pt;border-color:rgb(0,;border-style:none solid solid none;border-width:medium 1pt 1pt medium;padding:0 5.4pt;" valign="top" width="341">
<p class="MsoNormal"><span style="font-size:10pt;font-family:Arial;">Call this   method after the StatementComplete event fires to complete execution of the   command. </span></p>
</td>
</tr>
<tr style="height:49pt;">
<td style="width:120.75pt;height:49pt;border-color:#000000 black black;border-style:none solid solid;border-width:medium 1pt 1pt;padding:0 5.4pt;" valign="top" width="161">
<p class="MsoNormal"><span style="font-size:10pt;font-family:Arial;">EndExecuteReader   </span></p>
</td>
<td style="width:255.65pt;height:49pt;border-color:rgb(0,;border-style:none solid solid none;border-width:medium 1pt 1pt medium;padding:0 5.4pt;" valign="top" width="341">
<p class="MsoNormal"><span style="font-size:10pt;font-family:Arial;">Call this   method after the StatementComplete event fires to return the DataReader with   the data returned by the command. </span></p>
</td>
</tr>
<tr style="height:41.15pt;">
<td style="width:120.75pt;height:41.15pt;border-color:#000000 black black;border-style:none solid solid;border-width:medium 1pt 1pt;padding:0 5.4pt;" valign="top" width="161">
<p class="MsoNormal"><span style="font-size:10pt;font-family:Arial;">EndExecuteXMLReader   </span></p>
</td>
<td style="width:255.65pt;height:41.15pt;border-color:rgb(0,;border-style:none solid solid none;border-width:medium 1pt 1pt medium;padding:0 5.4pt;" valign="top" width="341">
<p class="MsoNormal"><span style="font-size:10pt;font-family:Arial;">Call this   method after the StatementComplete event fires to return the XmlReader with   the data returned by the command. </span></p>
</td>
</tr>
</table>
</div>
<p class="MsoNormal"><span style="font-family:'IBDEI I+ Berkeley Old ITC';"> </span></p>
<p class="MsoNormal"><span style="font-family:'IBDED H+ Berkeley Old ITC';color:black;"> </span></p>
<p class="MsoNormal" style="margin-bottom:5.25pt;text-align:justify;line-height:14pt;"><span style="font-size:10pt;font-family:Arial;">When executing commands asynchronously, you explicitly call the Begin and End methods of the selected Command object. Calling the Begin method sends the command (SQL statement or stored procedure call) to the database, and then you can perform other operations in your application. When the command finishes executing, the <b><i>StatementCompleted event fires</i></b>, notifying the application that it can call the End method of the command and access the data for further processing. </span></p>
<p class="MsoNormal" style="margin-bottom:19.65pt;text-align:justify;line-height:14pt;"><span style="font-size:10pt;font-family:Arial;"> </span></p>
<p class="MsoNormal" style="margin-bottom:19.65pt;text-align:justify;line-height:14pt;"><span style="font-size:10pt;font-family:Arial;"> </span></p>
<p class="MsoNormal" style="margin-bottom:19.65pt;text-align:justify;line-height:14pt;"><span style="font-size:10pt;font-family:Arial;"> </span></p>
<p class="MsoNormal" style="margin-bottom:19.65pt;text-align:justify;line-height:14pt;"><span style="font-size:10pt;font-family:Arial;"> </span></p>
<p class="MsoNormal" style="margin-bottom:19.65pt;text-align:justify;line-height:14pt;"><span style="font-size:10pt;font-family:Arial;"> </span></p>
<p class="MsoNormal" style="margin-bottom:19.65pt;text-align:justify;line-height:14pt;"><span style="font-size:10pt;font-family:Arial;"> </span></p>
<p class="MsoNormal" style="margin-bottom:19.65pt;text-align:justify;line-height:14pt;"><span style="font-size:10pt;font-family:Arial;"> </span></p>
<p class="MsoNormal" style="margin-bottom:19.65pt;text-align:justify;line-height:14pt;"><span style="font-size:10pt;font-family:Arial;"> </span></p>
<p class="MsoNormal" style="margin-bottom:19.65pt;text-align:justify;line-height:14pt;"><span style="font-size:10pt;font-family:Arial;"> </span></p>
<p class="MsoNormal" style="margin-bottom:19.65pt;text-align:justify;line-height:14pt;"><span style="font-size:10pt;font-family:Arial;"> </span></p>
<p class="MsoNormal"><span style="font-family:'IALFOF+LucidaSansTypewriter,Bol';color:black;"> </span></p>
<p class="MsoNormal"><span style="font-size:9pt;font-family:Arial;">// C#</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:Arial;">System.Text.StringBuilder results = new System.Text.StringBuilder();</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:Arial;">SqlConnection NorthWindConnection = new SqlConnection(&#8220;Data Source=.\\;Initial Catalog=Northwind;&#8221; +</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:Arial;">&#8220;Integrated Security=True; <b><i>asynchronous processing = true</i></b>&#8220;);</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:Arial;">SqlCommand command1 = new SqlCommand(&#8220;WAITFOR DELAY &#8217;00:00:05&#8242;; &#8221; +</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:Arial;">Select * From [Order Details]&#8220;, NorthWindConnection);</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:Arial;">NorthWindConnection.Open();</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:Arial;">IAsyncResult r = command1.BeginExecuteReader();</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:Arial;">MessageBox.Show(&#8220;The command has been executed but processing is free &#8221; + &#8220;to display this message before the results have been returned!&#8221;);</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:Arial;">SqlDataReader reader = command1.EndExecuteReader(r);</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:Arial;">while (reader.Read())</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:Arial;">{</span></p>
<p class="MsoNormal" style="text-indent:0.5in;"><span style="font-size:10pt;font-family:Arial;">for (int i = 0; i&lt; reader.FieldCount &#8211; 1; i++)</span></p>
<p class="MsoNormal" style="text-indent:0.5in;"><span style="font-size:10pt;font-family:Arial;">{</span></p>
<p class="MsoNormal" style="margin-left:0.5in;text-indent:0.5in;"><span style="font-size:10pt;font-family:Arial;">results.Append(reader[i].ToString() + &#8220;\t&#8221;);</span></p>
<p class="MsoNormal" style="text-indent:0.5in;"><span style="font-size:10pt;font-family:Arial;">}</span></p>
<p class="MsoNormal" style="text-indent:0.5in;"><span style="font-size:10pt;font-family:Arial;">results.Append(Environment.NewLine);</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:Arial;">}</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:Arial;">reader.Close();</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:Arial;">command1.Connection.Close();</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:Arial;">MessageBox.Show(results.ToString());</span></p>
<p class="MsoNormal" style="margin-bottom:19.65pt;text-align:justify;line-height:14pt;"><span style="font-size:10pt;font-family:Arial;"> </span></p>
<p class="MsoNormal"><span style="font-family:'IBEHF F+ Segoe';color:black;"> </span></p>
<p class="MsoNormal"><span style="font-family:'IBEHF F+ Segoe';color:black;"> </span></p>
<p class="MsoNormal"><span style="font-family:'IBEHF F+ Segoe';color:black;"> </span></p>
<p class="MsoNormal"><span style="font-family:'IBEHF F+ Segoe';color:black;"> </span></p>
<p class="MsoNormal"><span style="font-family:'IBEHF F+ Segoe';color:black;"> </span></p>
<p class="MsoNormal"><span style="font-family:'IBEHF F+ Segoe';color:black;"> </span></p>
<p class="MsoNormal"><span style="font-family:'IBEHF F+ Segoe';color:black;"> </span></p>
<p class="MsoNormal"><span style="font-family:'IBEHF F+ Segoe';color:black;"> </span></p>
<p class="MsoNormal"><span style="font-family:'IBEHF F+ Segoe';color:black;"> </span></p>
<p class="MsoNormal"><span style="font-family:'IBEHF F+ Segoe';color:black;"> </span></p>
<p class="MsoNormal"><span style="font-family:'IBEHF F+ Segoe';color:black;"> </span></p>
<p class="MsoNormal"><span style="font-family:'IBEHF F+ Segoe';color:black;"> </span></p>
<p class="MsoNormal"><span style="font-family:'IBEHF F+ Segoe';color:black;"> </span></p>
<p class="MsoNormal"><span style="font-family:'IBEHF F+ Segoe';color:black;"> </span></p>
<p class="MsoNormal"><span style="font-family:'IBEHF F+ Segoe';color:black;"> </span></p>
<p class="MsoNormal"><span style="font-family:'IBEHF F+ Segoe';color:black;"> </span></p>
<p class="MsoNormal"><span style="font-family:'IBEHF F+ Segoe';color:black;"> </span></p>
<p class="MsoNormal"><span style="font-family:'IBEHF F+ Segoe';color:black;"> </span></p>
<p class="MsoNormal"><span style="font-family:'IBEHF F+ Segoe';color:black;"> </span></p>
<p class="MsoNormal"><b><span style="font-size:10pt;font-family:Arial;">Executing Multiple SQL Statements Using a DataReader </span></b></p>
<p class="MsoNormal" style="line-height:14pt;"><span style="font-size:10pt;font-family:Arial;">In addition to returning the results from a single SQL statement, you can use a Command object and DataReader to return the results of multiple SQL statements. <i>To execute more than one SQL statement, set the CommandText property of a Command object to multiple SQL statements separated by semicolons (;)</i>. After calling the ExecuteReader method, the DataReader will hold the number of result sets equal to the number of SQL statements executed. To access the data returned by the additional statements, call the <i>NextResult method of the DataReader.</i> </span></p>
<p class="MsoNormal"><span style="color:black;"> </span></p>
<p class="MsoNormal"><span style="font-size:9pt;font-family:Arial;">ExecuteSqlCommand.CommandText = &#8220;SELECT CustomerID, CompanyName FROM Customers; SELECT ProductName, UnitsInStock FROM Products&#8221;;</span></p>
<p class="MsoNormal"><span style="font-size:9pt;font-family:Arial;">SqlDataReader reader = ExecuteSqlCommand.ExecuteReader(); </span></p>
<p class="MsoNormal"><span style="font-size:9pt;font-family:Arial;"> </span></p>
<p class="MsoNormal"><span style="font-size:9pt;font-family:Arial;">bool MoreResults = false; </span></p>
<p class="MsoNormal"><span style="font-size:9pt;font-family:Arial;">do </span></p>
<p class="MsoNormal"><span style="font-size:9pt;font-family:Arial;">{ </span></p>
<p class="MsoNormal" style="text-indent:0.5in;"><span style="font-size:9pt;font-family:Arial;">while (reader.Read()) </span></p>
<p class="MsoNormal" style="text-indent:0.5in;"><span style="font-size:9pt;font-family:Arial;">{ </span></p>
<p class="MsoNormal" style="margin-left:0.5in;text-indent:0.5in;"><span style="font-size:9pt;font-family:Arial;">for (int i = 0; i &lt; reader.FieldCount; i++) </span></p>
<p class="MsoNormal" style="margin-left:0.5in;text-indent:0.5in;"><span style="font-size:9pt;font-family:Arial;">{ </span></p>
<p class="MsoNormal" style="margin-left:1in;text-indent:0.5in;"><span style="font-size:9pt;font-family:Arial;">results.Append(reader[i].ToString() + &#8220;\t&#8221;); </span></p>
<p class="MsoNormal" style="margin-left:0.5in;text-indent:0.5in;"><span style="font-size:9pt;font-family:Arial;">}</span></p>
<p class="MsoNormal" style="margin-left:0.5in;text-indent:0.5in;"><span style="font-size:9pt;font-family:Arial;">results.Append(Environment.NewLine); </span></p>
<p class="MsoNormal" style="text-indent:0.5in;"><span style="font-size:9pt;font-family:Arial;">} </span></p>
<p class="MsoNormal" style="text-indent:0.5in;"><span style="font-size:9pt;font-family:Arial;">MoreResults = reader.NextResult(); </span></p>
<p class="MsoNormal"><span style="font-size:9pt;font-family:Arial;">} while (MoreResults); </span></p>
<p class="MsoNormal" style="margin-bottom:19.65pt;text-align:justify;line-height:14pt;"><span style="font-size:10pt;font-family:Arial;"> </span></p>
<p class="MsoNormal"><b><span style="font-size:10pt;font-family:Arial;">Working with Parameters in SQL Commands </span></b></p>
<p class="MsoNormal" style="margin-bottom:5.25pt;text-align:justify;line-height:14pt;"><span style="font-size:10pt;font-family:Arial;">A parameter can be thought of as a type of variable that you can use to pass and return values between your application and a database. Just like a variable in your application, parameters are created to contain a certain data type. Parameter data types are assigned using the types defined in the <i>System.Data.SqlDbType</i> enumeration. The SqlDbType enumeration contains a list of the types available in SQL Server as opposed to application variables that are typically assigned one of the .NET Framework base data types. </span></p>
<p class="MsoNormal"><b><span style="font-size:10pt;font-family:Arial;">Types of Parameters </span></b></p>
<p class="MsoNormal" style="margin-bottom:19.65pt;line-height:14pt;"><span style="font-size:10pt;font-family:Arial;">When executing Command objects, you typically use parameters to send data to the database. This type of parameter is referred to as an <i>Input</i> parameter. In addition to Input parameters, you might also want to use a parameter to retrieve information coming out of the database; this type of parameter is called an <i>Output</i> parameter. There is also a third type of parameter, which is referred to as an <i>InputOutput</i> parameter. InputOutput parameters are used to both send and receive data when executing a command. The type of parameter is designated in the <i>Direction</i> property of the parameter and is assigned a value from the <i>ParameterDirection</i> enumeration. In other words, when creating a parameter, you can set its Direction property to Input, Output, InputOutput, or ReturnValue</span><span style="font-size:11pt;font-family:'IBDED H+ Berkeley Old ITC';color:black;">. </span></p>
<p class="MsoNormal"><b><span style="font-size:10pt;font-family:Arial;">Parameters are <i>Input</i> type by default.</span></b></p>
<p class="MsoNormal"><span style="font-size:9pt;font-family:Arial;"> </span></p>
<p class="MsoNormal"><span style="font-size:9pt;font-family:Arial;"> </span></p>
<p class="MsoNormal"><span style="font-size:9pt;font-family:Arial;"> </span></p>
<p class="MsoNormal"><span style="font-size:9pt;font-family:Arial;"> </span></p>
<p class="MsoNormal"><span style="font-size:9pt;font-family:Arial;"> </span></p>
<p class="MsoNormal"><span style="font-family:'IBEHF F+ Segoe';color:black;"> </span></p>
<p class="MsoNormal"><b><span style="font-size:10pt;font-family:Arial;">Creating Parameters </span></b><span style="font-size:10pt;font-family:Arial;"></span></p>
<p class="MsoNormal" style="margin-bottom:5.25pt;text-align:justify;line-height:14pt;"><span style="font-size:10pt;font-family:Arial;">Create parameters by declaring an instance of the Parameter class and setting its name and data type to coincide with the parameter name and data type expected by the data source. You can also set the parameter’s ParameterDirection property to choose the type of parameter to create. </span></p>
<p class="MsoNormal"><span style="font-size:9pt;font-family:Arial;"> </span></p>
<p class="MsoNormal"><span style="font-size:9pt;font-family:Arial;"> </span></p>
<p class="MsoNormal"><span style="font-size:9pt;font-family:Arial;">SqlParameter TotalCostParameter = new SqlParameter(); </span></p>
<p class="MsoNormal"><span style="font-size:9pt;font-family:Arial;">TotalCostParameter.ParameterName = &#8220;@TotalCost&#8221;; </span></p>
<p class="MsoNormal"><span style="font-size:9pt;font-family:Arial;">TotalCostParameter.SqlDbType = SqlDbType.Money;</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:Arial;"> </span></p>
<p class="MsoNormal"><b><span style="font-size:10pt;font-family:Arial;"> </span></b></p>
<p class="MsoNormal"><b><span style="font-size:10pt;font-family:Arial;">Adding Parameters to Command Objects </span></b></p>
<p class="MsoNormal"><span style="font-size:9pt;font-family:Arial;"> </span></p>
<p class="MsoNormal"><span style="font-size:9pt;font-family:Arial;">GetCostCommand.Parameters.Add(TotalCostParameter); </span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:Arial;"> </span></p>
<p class="MsoNormal"><span style="font-family:'IBEHE E+ Segoe';color:black;"> </span></p>
<p class="MsoNormal"><b><span style="font-size:10pt;font-family:Arial;">Saving and Retrieving BLOB Values in a Database </span></b></p>
<p class="MsoNormal" style="margin-bottom:19.65pt;text-align:justify;line-height:14pt;"><span style="font-size:10pt;font-family:Arial;">BLOBs in a database are more complex than simple strings containing names and addresses or numeric values containing integers or money values<b><i>. BLOBs are things like graphics and photos</i></b>, documents saved in <b><i>binary formats</i></b>, and even complete assemblies or executables that you want to store in a database</span><span style="font-size:11pt;font-family:'IBDED H+ Berkeley Old ITC';color:black;">. </span></p>
<p class="MsoNormal" style="margin-bottom:19.65pt;text-align:justify;line-height:14pt;"><b><span style="font-size:10pt;font-family:Arial;">Working with BLOBs </span></b></p>
<p class="MsoNormal" style="margin-bottom:19.65pt;text-align:justify;line-height:14pt;"><span style="font-size:10pt;font-family:Arial;">Saving and fetching binary data presents interesting problems that are typically not encountered when querying standard rows of data. The problems arise because you will probably not want to move the entire BLOB in one piece but will likely need to break it up into smaller portions. For example, consider having to move a <i>large binary that is several megabytes in size</i>. Loading the entire BLOB into a variable consumes a lot of memory and can seriously affect the performance of your application. Having to work with a table of these BLOBs, you can quickly see the dilemma. </span></p>
<p class="MsoNormal" style="margin-bottom:19.65pt;text-align:justify;line-height:14pt;"><span style="font-size:10pt;font-family:Arial;">The good thing is that the .NET Framework provides classes that are specifically designed for moving large amounts of binary data. Specifically, access to these classes—for example, the BinaryReader and BinaryWriter classes, the FileStream and MemoryStream classes, and so on—is enabled in the System.IO namespace. Although this lesson does not use all the available stream objects, it should provide enough of a starting point to understand the basics of saving and fetching binary data from a database. </span></p>
<p class="MsoNormal"><b><span style="font-size:10pt;font-family:Arial;">BLOBs and the <i>DataReader</i> </span></b></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:Arial;"> </span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:Arial;">By setting its <b><i>CommandBehavior to SequentialAccess</i></b>, you can then call the <b><i>GetBytes</i></b> method, which allows you to read the data in smaller, user-definable amounts. The bytes that make up a BLOB are transported in and out of the database to your application using byte arrays</span>.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/mcts2005.wordpress.com/8/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/mcts2005.wordpress.com/8/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mcts2005.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mcts2005.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mcts2005.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mcts2005.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mcts2005.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mcts2005.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mcts2005.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mcts2005.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mcts2005.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mcts2005.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mcts2005.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mcts2005.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mcts2005.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mcts2005.wordpress.com/8/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mcts2005.wordpress.com&amp;blog=2471586&amp;post=8&amp;subd=mcts2005&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mcts2005.wordpress.com/2008/01/11/mcts70-526-windows-based-client-development-chapter-6-summary/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/567cf68949cef0b0740564e0599aaeee?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Mayur Kotlikar</media:title>
		</media:content>
	</item>
		<item>
		<title>MCTS(70-526) Windows-Based Client Development &#8211; Chapter 5 Summary</title>
		<link>http://mcts2005.wordpress.com/2008/01/11/mcts70-526-windows-based-client-development-chapter-5-summary/</link>
		<comments>http://mcts2005.wordpress.com/2008/01/11/mcts70-526-windows-based-client-development-chapter-5-summary/#comments</comments>
		<pubDate>Fri, 11 Jan 2008 07:10:29 +0000</pubDate>
		<dc:creator>Mayur Kotlikar</dc:creator>
				<category><![CDATA[C# MCTS]]></category>
		<category><![CDATA[ADO.Net]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[mcts]]></category>
		<category><![CDATA[sql server]]></category>

		<guid isPermaLink="false">http://mcts2005.wordpress.com/2008/01/11/mcts70-526-windows-based-client-development-chapter-5-summary/</guid>
		<description><![CDATA[Chapter 5 Configuring connections and connecting to data What is ADO.Net? When creating applications that work with data, the Microsoft .NET Framework provides many classes that aid in the process. The classes that you use for common data tasks such as communicating, storing, fetching, and updating data are all located in the System.Data namespace. The [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mcts2005.wordpress.com&amp;blog=2471586&amp;post=7&amp;subd=mcts2005&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p class="MsoNormal"><b><span style="font-size:10pt;font-family:Arial;">Chapter 5</span></b></p>
<p class="MsoNormal"><b><span style="font-size:10pt;font-family:Arial;">Configuring connections and connecting to data</span></b></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:Arial;"> </span></p>
<p class="MsoNormal"><b><span style="font-size:10pt;font-family:Arial;">What is ADO.Net?</span></b></p>
<p class="CM365" style="text-align:justify;line-height:14pt;"><span style="font-size:10pt;font-family:Arial;color:black;">When creating applications that work with data, the Microsoft .NET Framework provides many classes that aid in the process. The classes that you use for common data tasks such as communicating, storing, fetching, and updating data are all located in the <i>System.Data </i>namespace. <i>The classes in the <span>System.Data </span>namespace</i> make up the core data access objects in the .NET Framework. <b><i>These data access classes are collectively known as ADO.NET</i></b>. </span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:Arial;"> </span></p>
<p class="MsoNormal"><b><span style="font-size:10pt;font-family:Arial;">What is a Connection object?</span></b></p>
<p class="CM25" style="text-align:justify;"><span style="font-size:10pt;font-family:Arial;color:black;">A connection object is simply a representation of an open connection to a data source. </span></p>
<p class="CM25" style="text-align:justify;"><span style="font-size:10pt;font-family:Arial;color:black;">A connection object does not fetch or update data, it does not execute queries, and it does not contain the results of queries; it is merely the <b><i>pipeline</i></b> that commands and queries use to send their SQL statements and receive results. </span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:Arial;"> </span></p>
<p class="MsoNormal"><b><span style="font-size:10pt;font-family:Arial;">Connection events</span></b></p>
<p class="CM25" style="text-align:justify;"><span style="font-size:10pt;font-family:Arial;color:black;">Connection objects provide the <b><i>StateChanged</i></b> and <b><i>InfoMessage</i></b> events to provide information to your application regarding the status of the database and information pertaining to commands executed using a specific connection object. </span></p>
<p class="MsoNormal"><b><span style="font-size:10pt;font-family:Arial;color:black;">StateChanged Event</span></b><span style="font-size:10pt;font-family:Arial;color:black;"> </span></p>
<p class="MsoNormal" style="text-align:justify;"><span style="font-size:10pt;font-family:Arial;color:black;">This event is raised when the current state of the database changes from Open to Closed. </span></p>
<p class="MsoNormal"><b><span style="font-size:10pt;font-family:Arial;color:black;"> </span></b></p>
<p class="MsoNormal"><b><span style="font-size:10pt;font-family:Arial;color:black;">InfoMessage Event</span></b><span style="font-size:10pt;font-family:Arial;color:black;"> </span></p>
<p class="MsoNormal" style="text-align:justify;"><span style="font-size:10pt;font-family:Arial;color:black;">In addition to monitoring the state of a connection, each connection object provides an InfoMessage event that is raised when warnings or messages are returned from the server. Informational messages are typically provided when low-severity errors are returned by the data source that the connection object is connected to. For example, SQL Server errors with a severity of 10 or less are provided to the InfoMessage event</span><span style="font-size:10pt;font-family:'IBDED H+ Berkeley Old ITC';color:black;">. </span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:'IBDED H+ Berkeley Old ITC';color:black;"> </span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:'IBEHF F+ Segoe';color:black;"> </span></p>
<p class="MsoNormal"><b><span style="font-size:10pt;font-family:Arial;">What Is Connection Pooling? </span></b></p>
<p class="MsoNormal" style="text-align:justify;"><span style="font-size:10pt;font-family:Arial;color:black;">Connection pooling enables the reuse of existing connections to reduce the overhead of continuously creating and disposing of connections that have the same configuration. In other words, opening and closing connections that use the same connection string and credentials can reuse a connection that is available in the pool. </span></p>
<p class="MsoNormal" style="text-align:justify;"><span style="font-size:10pt;font-family:Arial;color:black;">Connection pools are separated by process, application domain, and connection string. <b><i>For connection strings that use integrated security, a separate pool is created for each unique identity </i></b></span></p>
<p class="MsoNormal"><span style="font-size:9pt;font-family:Arial;"> </span></p>
<p class="MsoNormal"><b><span style="font-size:10pt;font-family:Arial;">Controlling connection pooling</span></b></p>
<p class="MsoNormal" style="text-align:justify;"><span style="font-size:10pt;font-family:Arial;color:black;">Connection pooling is enabled by <b><i>default</i></b> when creating ADO.NET connection objects. You can control connection pooling behavior (or disable pooling altogether) by setting <i>connection string keywords specific to connection pooling</i>. For example, to specifically disable connection pooling, you set Pooling=False in your connection string </span></p>
<p class="MsoNormal" style="text-align:justify;"><span style="font-size:10pt;font-family:Arial;color:black;"> </span></p>
<p class="MsoNormal" style="text-align:justify;"><span style="font-size:10pt;font-family:Arial;color:black;"> </span></p>
<p class="MsoNormal" style="text-align:justify;"><span style="font-size:10pt;font-family:Arial;color:black;"> </span></p>
<p class="MsoNormal" style="text-align:justify;"><span style="font-size:10pt;font-family:Arial;color:black;"> </span></p>
<div align="center">
<table class="MsoNormalTable" style="border:medium none;border-collapse:collapse;" border="1" cellpadding="0" cellspacing="0">
<tr style="height:71.5pt;">
<td style="border:1pt solid black;width:104.9pt;height:71.5pt;padding:0 5.4pt;" valign="top" width="140">
<p class="MsoNormal"><span style="font-size:10pt;font-family:Arial;">Connection Lifetime </span></p>
</td>
<td style="width:41.65pt;height:71.5pt;border-color:black black black #000000;border-style:solid solid solid none;border-width:1pt 1pt 1pt medium;padding:0 5.4pt;" valign="top" width="56">
<p class="MsoNormal"><span style="font-size:10pt;font-family:Arial;">0 </span></p>
</td>
<td style="width:231.5pt;height:71.5pt;border-color:black black black #000000;border-style:solid solid solid none;border-width:1pt 1pt 1pt medium;padding:0 5.4pt;" valign="top" width="309">
<p class="MsoNormal"><span style="font-size:10pt;font-family:Arial;">When a connection is returned to   the pool, if its creation time was longer than x seconds ago, with x being   the value of this property, then the connection is destroyed. Values are in   seconds, and a value of 0 indicates the maximum connection timeout. </span></p>
</td>
</tr>
<tr style="height:71.5pt;">
<td style="width:104.9pt;height:71.5pt;border-color:#000000 black black;border-style:none solid solid;border-width:medium 1pt 1pt;padding:0 5.4pt;" valign="top" width="140">
<p class="MsoNormal"><span style="font-size:10pt;font-family:Arial;">Connection Reset </span></p>
</td>
<td style="width:41.65pt;height:71.5pt;border-color:rgb(0,;border-style:none solid solid none;border-width:medium 1pt 1pt medium;padding:0 5.4pt;" valign="top" width="56">
<p class="MsoNormal"><span style="font-size:10pt;font-family:Arial;">True </span></p>
</td>
<td style="width:231.5pt;height:71.5pt;border-color:rgb(0,;border-style:none solid solid none;border-width:medium 1pt 1pt medium;padding:0 5.4pt;" valign="top" width="309">
<p class="MsoNormal"><span style="font-size:10pt;font-family:Arial;">Determines whether the database   connection is reset when being drawn from the pool. For SQL Server 7.0,   setting to False avoids making an additional server round trip when obtaining   a connection, but the connection state, such as database context, is not   being reset. </span></p>
</td>
</tr>
<tr style="height:44.5pt;">
<td style="width:104.9pt;height:44.5pt;border-color:#000000 black black;border-style:none solid solid;border-width:medium 1pt 1pt;padding:0 5.4pt;" valign="top" width="140">
<p class="MsoNormal"><span style="font-size:10pt;font-family:Arial;">Enlist </span></p>
</td>
<td style="width:41.65pt;height:44.5pt;border-color:rgb(0,;border-style:none solid solid none;border-width:medium 1pt 1pt medium;padding:0 5.4pt;" valign="top" width="56">
<p class="MsoNormal"><span style="font-size:10pt;font-family:Arial;">True </span></p>
</td>
<td style="width:231.5pt;height:44.5pt;border-color:rgb(0,;border-style:none solid solid none;border-width:medium 1pt 1pt medium;padding:0 5.4pt;" valign="top" width="309">
<p class="MsoNormal"><span style="font-size:10pt;font-family:Arial;">If you want to use a connection as   part of a transaction you can set this to True and the pooler will   automatically enlist the connection in the creation thread’s current   transaction context. </span></p>
</td>
</tr>
<tr style="height:43.15pt;">
<td style="width:104.9pt;height:43.15pt;border-color:#000000 black black;border-style:none solid solid;border-width:medium 1pt 1pt;padding:0 5.4pt;" valign="top" width="140">
<p class="MsoNormal"><span style="font-size:10pt;font-family:Arial;">Load Balance Timeout </span></p>
</td>
<td style="width:41.65pt;height:43.15pt;border-color:rgb(0,;border-style:none solid solid none;border-width:medium 1pt 1pt medium;padding:0 5.4pt;" valign="top" width="56">
<p class="MsoNormal"><span style="font-size:10pt;font-family:Arial;">0 </span></p>
</td>
<td style="width:231.5pt;height:43.15pt;border-color:rgb(0,;border-style:none solid solid none;border-width:medium 1pt 1pt medium;padding:0 5.4pt;" width="309">
<p class="MsoNormal"><span style="font-size:10pt;font-family:Arial;">The minimum number of seconds for   the connection to live in the connection pool before being destroyed. </span></p>
</td>
</tr>
<tr style="height:149.35pt;">
<td style="width:104.9pt;height:149.35pt;border-color:#000000 black black;border-style:none solid solid;border-width:medium 1pt 1pt;padding:0 5.4pt;" valign="top" width="140">
<p class="MsoNormal"><span style="font-size:10pt;font-family:Arial;">Max Pool Size </span></p>
</td>
<td style="width:41.65pt;height:149.35pt;border-color:rgb(0,;border-style:none solid solid none;border-width:medium 1pt 1pt medium;padding:0 5.4pt;" valign="top" width="56">
<p class="MsoNormal"><span style="font-size:10pt;font-family:Arial;">100 </span></p>
</td>
<td style="width:231.5pt;height:149.35pt;border-color:rgb(0,;border-style:none solid solid none;border-width:medium 1pt 1pt medium;padding:0 5.4pt;" valign="top" width="309">
<p class="MsoNormal"><span style="font-size:10pt;font-family:Arial;">The maximum number of connections   allowed in the pool for this specific connection string. In other words if   your application continuously connects to the database you might need to   increase the Max Pool Size. For example, if your application has many users   that all use the same connection string and there is the possibility of   needing more than 100 connections you would want to increase the Max Pool   Size, this may occur when many users are accessing the database server using   a common client or Web page. </span></p>
</td>
</tr>
<tr style="height:29.65pt;">
<td style="width:104.9pt;height:29.65pt;border-color:#000000 black black;border-style:none solid solid;border-width:medium 1pt 1pt;padding:0 5.4pt;" valign="top" width="140">
<p class="MsoNormal"><span style="font-size:10pt;font-family:Arial;color:black;">Min Pool Size</span><span style="font-size:10pt;font-family:Arial;"></span></p>
</td>
<td style="width:41.65pt;height:29.65pt;border-color:rgb(0,;border-style:none solid solid none;border-width:medium 1pt 1pt medium;padding:0 5.4pt;" valign="top" width="56">
<p class="MsoNormal"><span style="font-size:10pt;font-family:Arial;">0</span></p>
</td>
<td style="width:231.5pt;height:29.65pt;border-color:rgb(0,;border-style:none solid solid none;border-width:medium 1pt 1pt medium;padding:0 5.4pt;" valign="top" width="309">
<p class="MsoNormal"><span style="font-size:10pt;font-family:Arial;color:black;">The minimum number of   connections allowed in the pool.</span><span style="font-size:10pt;font-family:Arial;"></span></p>
</td>
</tr>
<tr style="height:52.15pt;">
<td style="width:104.9pt;height:52.15pt;border-color:#000000 black black;border-style:none solid solid;border-width:medium 1pt 1pt;padding:0 5.4pt;" valign="top" width="140">
<p class="MsoNormal"><span style="font-size:10pt;font-family:Arial;color:black;">Pooling</span></p>
</td>
<td style="width:41.65pt;height:52.15pt;border-color:rgb(0,;border-style:none solid solid none;border-width:medium 1pt 1pt medium;padding:0 5.4pt;" valign="top" width="56">
<p class="MsoNormal"><span style="font-size:10pt;font-family:Arial;">True</span></p>
</td>
<td style="width:231.5pt;height:52.15pt;border-color:rgb(0,;border-style:none solid solid none;border-width:medium 1pt 1pt medium;padding:0 5.4pt;" valign="top" width="309">
<p class="MsoNormal"><span style="font-size:10pt;font-family:Arial;color:black;">When true, the <i>SqlConnection   </i>object is drawn from the appropriate pool or, if it is required, is   created and added to the appropriate pool. Recognized values are <i>True</i>,   <i>False</i>, <i>Yes</i>, and <i>No</i>.</span></p>
</td>
</tr>
</table>
</div>
<p class="MsoNormal"><span style="font-family:'IBDEI I+ Berkeley Old ITC';"> </span></p>
<p class="MsoNormal"><span style="font-family:'IBDEI I+ Berkeley Old ITC';"> </span></p>
<p class="MsoNormal"><b><span style="font-size:10pt;font-family:Arial;">Handling connection errors</span></b></p>
<p class="MsoNormal" style="margin-bottom:19.65pt;text-align:justify;line-height:14pt;"><span style="font-size:10pt;font-family:Arial;color:black;">When SQL Server returns a warning or an error, the .NET Framework Data Provider for SQL Server creates and throws a SqlException that you can catch in your application to deal with the problem. When SqlException is thrown, inspect the <b>SqlException.Errors</b> property to access the collection of errors that are returned from the SQL server. The SqlException.Errors property is a SqlErrorCollection class (a collection of SqlError classes) that always contains at least one SqlError object</span><span style="font-size:11pt;font-family:'IBDED H+ Berkeley Old ITC';color:black;">. </span></p>
<p class="MsoNormal" style="margin-bottom:19.65pt;text-align:justify;line-height:14pt;"><b><i><span style="font-size:10pt;font-family:Arial;color:black;">SqlConnection will remain open for messages with a severity level of 19 and below, but it will typically close automatically when the severity is 20 or greater. </span></i></b></p>
<p class="MsoNormal"><span style="color:black;"> </span></p>
<p class="MsoNormal" style="margin-left:34.4pt;text-indent:16.85pt;line-height:10pt;"><span style="font-size:9pt;font-family:Arial;color:black;">catch (SqlException ex)</span></p>
<p class="MsoNormal" style="margin-left:34.4pt;text-indent:16.85pt;line-height:10pt;"><span style="font-size:9pt;font-family:Arial;color:black;">{</span></p>
<p class="MsoNormal" style="margin-left:1in;line-height:10pt;"><span style="font-size:9pt;font-family:Arial;color:black;">string errorMessage = “”;</span></p>
<p class="MsoNormal" style="margin-left:1in;line-height:10pt;"><span style="font-size:9pt;font-family:Arial;color:black;"> </span></p>
<p class="MsoNormal" style="margin-left:1in;line-height:10pt;"><span style="font-size:9pt;font-family:Arial;color:black;">foreach (SqlError ConnectionError in ex.Errors)</span></p>
<p class="MsoNormal" style="margin-left:1in;line-height:10pt;"><span style="font-size:9pt;font-family:Arial;color:black;">{ </span></p>
<p class="MsoNormal" style="margin-left:68.75pt;line-height:10pt;"><span style="font-size:9pt;font-family:Arial;color:black;"> </span></p>
<p class="MsoNormal" style="margin-left:82.4pt;text-indent:25.6pt;line-height:10pt;"><span style="font-size:9pt;font-family:Arial;color:black;">errorMessage += ConnectionError.Message + &#8221; (error: &#8221; +</span></p>
<p class="MsoNormal" style="margin-left:118.4pt;line-height:10pt;"><span style="font-size:9pt;font-family:Arial;color:black;">ConnectionError.Number.ToString() + &#8220;)&#8221; + Environment.NewLine;</span></p>
<p class="MsoNormal" style="margin-left:118.4pt;line-height:10pt;"><span style="font-size:9pt;font-family:Arial;color:black;">if (ConnectionError.Number == 18452)</span></p>
<p class="MsoNormal" style="margin-left:118.4pt;line-height:10pt;"><span style="font-size:9pt;font-family:Arial;color:black;">{ </span></p>
<p class="MsoNormal" style="margin-left:2in;line-height:10pt;"><span style="font-size:9pt;font-family:Arial;color:black;">MessageBox.Show(&#8220;Invalid Login Detected, please provide valid credentials!&#8221;);</span></p>
<p class="MsoNormal" style="margin-left:1.5in;line-height:10pt;"><span style="font-size:9pt;font-family:Arial;color:black;"><span>    </span>}</span></p>
<p class="MsoNormal" style="margin-left:51.9pt;text-indent:16.75pt;line-height:10pt;"><span style="font-size:9pt;font-family:Arial;color:black;">}</span></p>
<p class="MsoNormal" style="margin-left:51.9pt;text-indent:16.75pt;line-height:10pt;"><span style="font-size:9pt;font-family:Arial;color:black;">MessageBox.Show(errorMessage);</span></p>
<p class="MsoNormal" style="margin-left:42.05pt;text-indent:1.5pt;line-height:10pt;"><span style="font-size:9pt;font-family:Arial;color:black;">} </span></p>
<p class="MsoNormal" style="margin-left:42.05pt;text-indent:1.5pt;line-height:10pt;"><span style="font-size:9pt;font-family:Arial;color:black;">finally</span></p>
<p class="MsoNormal" style="margin-left:42.05pt;text-indent:1.5pt;line-height:10pt;"><span style="font-size:9pt;font-family:Arial;color:black;">{</span></p>
<p class="MsoNormal" style="margin-left:0.5in;text-indent:0.5in;"><span style="font-size:9pt;font-family:Arial;">connection.Close();</span></p>
<p class="MsoNormal" style="text-indent:16.9pt;line-height:10pt;margin:0 298.5pt 5.25pt 26.65pt;"><span style="font-size:9pt;font-family:Arial;color:black;">}</span></p>
<p class="MsoNormal"><span style="font-size:9pt;font-family:Arial;"> </span></p>
<p class="MsoNormal"><span style="font-size:9pt;font-family:Arial;"> </span></p>
<p class="MsoNormal"><b><span style="font-size:10pt;font-family:Arial;">Enumerating the available SQL Servers on a network</span></b></p>
<p class="MsoNormal" style="margin-bottom:11.25pt;text-align:justify;line-height:14pt;"><span style="font-size:10pt;font-family:Arial;color:black;">The .NET Framework offers applications a way to discover SQL Server instances on a network so your programs can process this information when necessary. To retrieve the list of available SQL Servers, use the <b><i>Instance</i></b> property of the <b><i>SqlDataSourceEnumerator</i></b> class and call the <b><i>GetDataSources</i></b> method. The GetDataSources method returns a Data-Table that contains information for each SQL server that is visible on the network. The returned data table contains the columns </span></p>
<div align="center">
<table class="MsoTableGrid" style="border:medium none;border-collapse:collapse;" border="1" cellpadding="0" cellspacing="0">
<tr style="height:15.9pt;">
<td style="border:1pt solid windowtext;width:83.9pt;height:15.9pt;padding:0 5.4pt;" valign="top" width="112">
<p class="MsoNormal"><span style="font-size:9pt;font-family:Arial;">ServerName   </span></p>
</td>
<td style="width:286.15pt;height:15.9pt;border-color:windowtext windowtext windowtext #000000;border-style:solid solid solid none;border-width:1pt 1pt 1pt medium;padding:0 5.4pt;" valign="top" width="382">
<p class="MsoNormal"><span style="font-size:9pt;font-family:Arial;">Name of   the SQL server containing the visible instance </span></p>
</td>
</tr>
<tr style="height:17.75pt;">
<td style="width:83.9pt;height:17.75pt;border-color:#000000 windowtext windowtext;border-style:none solid solid;border-width:medium 1pt 1pt;padding:0 5.4pt;" valign="top" width="112">
<p class="MsoNormal"><span style="font-size:9pt;font-family:Arial;">InstanceName   </span></p>
</td>
<td style="width:286.15pt;height:17.75pt;border-color:rgb(0,;border-style:none solid solid none;border-width:medium 1pt 1pt medium;padding:0 5.4pt;" valign="top" width="382">
<p class="MsoNormal"><span style="font-size:9pt;font-family:Arial;">Name of   the server instance or empty for servers running default instances</span></p>
</td>
</tr>
<tr style="height:21pt;">
<td style="width:83.9pt;height:21pt;border-color:#000000 windowtext windowtext;border-style:none solid solid;border-width:medium 1pt 1pt;padding:0 5.4pt;" valign="top" width="112">
<p class="MsoNormal"><span style="font-size:9pt;font-family:Arial;">IsClustered   </span></p>
</td>
<td style="width:286.15pt;height:21pt;border-color:rgb(0,;border-style:none solid solid none;border-width:medium 1pt 1pt medium;padding:0 5.4pt;" valign="top" width="382">
<p class="MsoNormal"><span style="font-size:9pt;font-family:Arial;">Indicates   whether the server is part of a cluster </span></p>
</td>
</tr>
<tr style="height:15.15pt;">
<td style="width:83.9pt;height:15.15pt;border-color:#000000 windowtext windowtext;border-style:none solid solid;border-width:medium 1pt 1pt;padding:0 5.4pt;" valign="top" width="112">
<p class="MsoNormal"><span style="font-size:9pt;font-family:Arial;">Version </span></p>
</td>
<td style="width:286.15pt;height:15.15pt;border-color:rgb(0,;border-style:none solid solid none;border-width:medium 1pt 1pt medium;padding:0 5.4pt;" valign="top" width="382">
<p class="MsoNormal"><span style="font-size:9pt;font-family:Arial;">The   version number of the SQL server </span></p>
</td>
</tr>
</table>
</div>
<p class="MsoNormal"><span style="font-family:'IBDEI I+ Berkeley Old ITC';"> </span></p>
<p class="MsoNormal"><span style="font-family:'IBEHF F+ Segoe';color:black;"> </span></p>
<p class="MsoNormal"><b><span style="font-size:10pt;font-family:Arial;">Why Do Only Some or No SQL Servers Appear in My Grid? </span></b></p>
<p class="MsoNormal" style="margin-bottom:11.25pt;text-align:justify;line-height:14pt;"><span style="font-size:10pt;font-family:Arial;color:black;">Depending on how your network or even single machine is set up, the list of available servers may or may not be complete. In addition to things such as network traffic and timeout issues, the way your network implements security can cause servers to be hidden from the returned list as well. <b><i>If you are running SQL Server 2005, there is a service named SQL Browser that needs to be running to see SQL Server instances. And even if your SQL Browser service is running, your firewall may be blocking the request for SQL information</i></b>; the firewall is likely to be blocking communication requests through port 1433, which is the default port that SQL Server default instances are set up to use</span></p>
<p class="MsoNormal"><span style="color:black;"> </span></p>
<p class="MsoNormal"><span style="color:black;"> </span></p>
<p class="MsoNormal"><span style="color:black;"> </span></p>
<p class="MsoNormal"><b><span style="font-size:9pt;font-family:Arial;">Securing sensitive connection string data</span></b></p>
<p class="MsoNormal" style="text-align:justify;line-height:14pt;"><span style="font-size:10pt;font-family:Arial;color:black;">The suggested method of implementing security in applications that access data is to use <b><i>Windows Authentication (also known as Integrated Security).</i></b> To further protect sensitive connection information when using Integrated Security, it is also recommended that you <b><i>set the Persist Security Information keyword to False</i></b> in the connection string. This ensures that the credentials used to open the connection are discarded and not stored where someone might be able to retrieve them. </span></p>
<p class="MsoNormal" style="text-align:justify;line-height:14pt;"><span style="font-size:10pt;font-family:Arial;color:black;">Do <b><i>not</i></b> store the connection string in the compiled application. <b><i>As an alternative, you can use the application configuration file (app.config)</i></b>. The app.config file stores connection strings as XML, and your application gets its connection information by querying this file at run time (as opposed to compiling the connection string into the application itself). By default the application configuration file stores it’s information unencrypted </span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:Arial;color:black;">The suggested approach to encrypting configuration data is to use a protected-configuration provider. <b><i>There are two protected-configuration providers available in the .NET Framework</i></b> as well as a base class you can use to implement your own if the two available providers are not sufficient for your application. </span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:Arial;color:black;"> </span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:Arial;color:black;"> </span></p>
<p class="MsoNormal"><b><span style="font-size:10pt;font-family:Arial;color:black;">Encrypt:</span></b></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:Arial;color:black;">string provider = &#8220;DataProtectionConfigurationProvider&#8221;; </span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:Arial;color:black;">//Encrypt the connectionStrings</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:Arial;color:black;">ConfigurationSection connstrings = config.ConnectionStrings; connstrings.SectionInformation.ProtectSection(provider); </span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:Arial;color:black;">connstrings.SectionInformation.ForceSave = true; </span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:Arial;color:black;">config.Save(ConfigurationSaveMode</span><span style="font-size:9pt;font-family:Arial;">.Full); </span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:Arial;color:black;"> </span></p>
<p class="MsoNormal"><b><span style="font-size:10pt;font-family:Arial;color:black;">Decrypt:</span></b></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:Arial;color:black;">// Decrypt the connectionStrings </span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:Arial;color:black;">ConfigurationSection connstrings = config.ConnectionStrings; connstrings.SectionInformation.UnprotectSection();</span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:Arial;color:black;">connstrings.SectionInformation.ForceSave = true; </span></p>
<p class="MsoNormal"><span style="font-size:10pt;font-family:Arial;color:black;">config.Save(ConfigurationSaveMode.Full); </span></p>
<p class="MsoNormal"><span style="font-size:9pt;font-family:Arial;"> </span></p>
<p class="MsoNormal"><span style="font-size:9pt;font-family:Arial;"> </span></p>
<p class="MsoNormal"><span style="font-size:9pt;font-family:Arial;"> </span></p>
<p class="MsoNormal"><span style="font-size:9pt;font-family:Arial;"> </span></p>
<p class="MsoNormal"><span style="font-size:9pt;font-family:Arial;"> </span></p>
<p class="MsoNormal"><span style="font-size:9pt;font-family:Arial;"> </span></p>
<p class="MsoNormal"><span style="font-size:9pt;font-family:Arial;"> </span></p>
<p class="MsoNormal"><span style="font-size:9pt;font-family:Arial;"> </span></p>
<p class="MsoNormal"><span style="font-size:9pt;font-family:Arial;"> </span></p>
<p class="MsoNormal"><span style="font-size:9pt;font-family:Arial;"> </span></p>
<p class="MsoNormal"><span style="font-size:9pt;font-family:Arial;"> </span></p>
<p class="MsoNormal"><span style="font-size:9pt;font-family:Arial;"> </span></p>
<p class="MsoNormal"><span style="font-size:9pt;font-family:Arial;"> </span></p>
<p class="MsoNormal"><span style="font-size:9pt;font-family:Arial;"> </span></p>
<p class="MsoNormal"><span style="font-size:9pt;font-family:Arial;"> </span></p>
<p class="MsoNormal"><span style="font-size:9pt;font-family:Arial;"> </span></p>
<p class="MsoNormal"><span style="font-size:9pt;font-family:Arial;"> </span></p>
<p class="MsoNormal"><span style="font-size:9pt;font-family:Arial;"> </span></p>
<p class="MsoNormal"><span style="font-size:9pt;font-family:Arial;"> </span></p>
<p class="MsoNormal"><span style="font-size:9pt;font-family:Arial;"> </span></p>
<p class="MsoNormal"><span style="font-size:9pt;font-family:Arial;"> </span></p>
<p class="MsoNormal"><span style="font-size:9pt;font-family:Arial;"> </span></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/mcts2005.wordpress.com/7/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/mcts2005.wordpress.com/7/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mcts2005.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mcts2005.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mcts2005.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mcts2005.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mcts2005.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mcts2005.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mcts2005.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mcts2005.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mcts2005.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mcts2005.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mcts2005.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mcts2005.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mcts2005.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mcts2005.wordpress.com/7/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mcts2005.wordpress.com&amp;blog=2471586&amp;post=7&amp;subd=mcts2005&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mcts2005.wordpress.com/2008/01/11/mcts70-526-windows-based-client-development-chapter-5-summary/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/567cf68949cef0b0740564e0599aaeee?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Mayur Kotlikar</media:title>
		</media:content>
	</item>
		<item>
		<title>Encripting the Application Settings</title>
		<link>http://mcts2005.wordpress.com/2008/01/11/encripting-the-application-settings/</link>
		<comments>http://mcts2005.wordpress.com/2008/01/11/encripting-the-application-settings/#comments</comments>
		<pubDate>Fri, 11 Jan 2008 07:06:13 +0000</pubDate>
		<dc:creator>Mayur Kotlikar</dc:creator>
				<category><![CDATA[C# What I learned Today !]]></category>
		<category><![CDATA[app.config]]></category>
		<category><![CDATA[application setting encryption]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[ConfigurationManager]]></category>

		<guid isPermaLink="false">http://mcts2005.wordpress.com/2008/01/11/encripting-the-application-settings/</guid>
		<description><![CDATA[I learned something new today! In C# .Net 2005, an application required configuration information can be saved with Settings available in the Project,-&#62;Properties I think saving settings here are better than saving in Registry or creating a separate XML file for very trivial tasks. I wanted to encrypt this file and was searching for good [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mcts2005.wordpress.com&amp;blog=2471586&amp;post=3&amp;subd=mcts2005&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I learned something new today!</p>
<p>In C# .Net 2005, an application required configuration information can be saved with Settings available in the Project,-&gt;Properties</p>
<p>I think saving settings here are better than saving in Registry or creating a separate XML file for very trivial tasks.</p>
<p>I wanted to encrypt this file and was searching for good approaches.</p>
<p>I added couple of Settings with both Application and User scope using the IDE. (See the attached image &#8216;Settings.JPG&#8217;).<br />
<a href="http://mcts2005.files.wordpress.com/2008/01/settings.jpg" title="Setting"><img src="http://mcts2005.files.wordpress.com/2008/01/settings.jpg?w=450" alt="Setting" /></a></p>
<p>The configuration file is generated after the Build and I have attached image (&#8216;Original.JPG&#8217;)</p>
<p>Few lines of code and the file can be encrypted. See attached image (&#8216;Encrypted.JPG&#8217;)</p>
<p>(Add System.Configuration in Reference)</p>
<p><i><b>The code for Encryption:</b></i></p>
<p>Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);<br />
string provider = &#8220;DataProtectionConfigurationProvider&#8221;;<br />
//userSettings<br />
ConfigurationSectionGroup group = config.GetSectionGroup(&#8220;userSettings&#8221;);<br />
ConfigurationSection section = group.Sections[0];<br />
section.SectionInformation.ProtectSection(provider);</p>
<p>//applicationSettings<br />
group = config.GetSectionGroup(&#8220;applicationSettings&#8221;);<br />
section = group.Sections[0];<br />
section.SectionInformation.ProtectSection(provider);</p>
<p>section.SectionInformation.ForceSave = true;<br />
config.Save(ConfigurationSaveMode.Full);</p>
<p><i><b> Decryption:</b></i></p>
<p>Configuration config = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);</p>
<p>//userSettings<br />
ConfigurationSectionGroup group = config.GetSectionGroup(&#8220;userSettings&#8221;);<br />
ConfigurationSection section = group.Sections[0];<br />
section.SectionInformation.UnprotectSection();</p>
<p>//applicationSettings<br />
group = config.GetSectionGroup(&#8220;applicationSettings&#8221;);<br />
section = group.Sections[0];<br />
section.SectionInformation.UnprotectSection();</p>
<p>section.SectionInformation.ForceSave = true;<br />
config.Save(ConfigurationSaveMode.Full);</p>
<p><a href="http://mcts2005.files.wordpress.com/2008/01/original.jpg" title="Original"><img src="http://mcts2005.files.wordpress.com/2008/01/original.jpg?w=450" alt="Original" /></a><a href="http://mcts2005.files.wordpress.com/2008/01/encrypted.jpg" title="Encrypted"><img src="http://mcts2005.files.wordpress.com/2008/01/encrypted.jpg?w=450" alt="Encrypted" /></a></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/mcts2005.wordpress.com/3/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/mcts2005.wordpress.com/3/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mcts2005.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mcts2005.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mcts2005.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mcts2005.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mcts2005.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mcts2005.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mcts2005.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mcts2005.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mcts2005.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mcts2005.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mcts2005.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mcts2005.wordpress.com/3/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mcts2005.wordpress.com/3/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mcts2005.wordpress.com/3/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mcts2005.wordpress.com&amp;blog=2471586&amp;post=3&amp;subd=mcts2005&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mcts2005.wordpress.com/2008/01/11/encripting-the-application-settings/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/567cf68949cef0b0740564e0599aaeee?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Mayur Kotlikar</media:title>
		</media:content>

		<media:content url="http://mcts2005.files.wordpress.com/2008/01/settings.jpg" medium="image">
			<media:title type="html">Setting</media:title>
		</media:content>

		<media:content url="http://mcts2005.files.wordpress.com/2008/01/original.jpg" medium="image">
			<media:title type="html">Original</media:title>
		</media:content>

		<media:content url="http://mcts2005.files.wordpress.com/2008/01/encrypted.jpg" medium="image">
			<media:title type="html">Encrypted</media:title>
		</media:content>
	</item>
	</channel>
</rss>
