<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">
  <channel>
    <title>.NET Tip of The Day.org</title>
    <description>Learn one new .NET trick every day</description>
    <link>http://dotnettipoftheday.org/</link>
    <lastBuildDate>Tue, 26 Aug 2008 20:47:51 GMT</lastBuildDate>
    <docs>http://backend.userland.com/rss</docs>
    <generator>RSS.NET: http://www.rssdotnet.com/</generator>
    <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/dotNetTipOfTheDay" /><feedburner:info uri="dotnettipoftheday" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
      <title>How to respond with code 404 (Not Found) in ASP.NET</title>
      <description>&lt;p&gt;Suppose you configured custom 404 page in web.config file in the &lt;a href="http://msdn.microsoft.com/en-us/library/h0hfz6fc.aspx"&gt;customErrors &lt;/a&gt;section. So whenever user requests non-existent aspx page, ASP.NET run-time returns&amp;nbsp;well formatted&amp;nbsp;message to the user.&lt;/p&gt;
&lt;p&gt;Also you have a page that shows articles&amp;nbsp;from a&amp;nbsp;database according to article ID passed in the url (for example: article.aspx?id=345). But if user passes article ID that doesn't exists&amp;nbsp;the page must&amp;nbsp;return code 404 (Not Found) and show the&amp;nbsp;custom 404 page like in the&amp;nbsp;previous situation.&lt;/p&gt;
&lt;p&gt;Fortunately you don't need to parse the customErrors section&amp;nbsp;to get name of the custom 404 page. Just throw&amp;nbsp;&lt;a href="http://msdn.microsoft.com/en-us/library/system.web.httpexception.aspx"&gt;HttpException&lt;/a&gt;:&lt;/p&gt;
&lt;div style="font-family:Courier New; font-size:10pt; color:#000000"&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #0000ff;"&gt;throw&lt;/span&gt; &lt;span style="color: #0000ff;"&gt;new&lt;/span&gt; HttpException(404, "Article not found");&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;ASP.NET run-time&amp;nbsp;will catch the exception and will&amp;nbsp;redirect to the&amp;nbsp;custom 404.&lt;/p&gt;&lt;br /&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=how-to-respond-with-code-404-not-found-in-aspnet"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=how-to-respond-with-code-404-not-found-in-aspnet" border="0"/&gt;&lt;/a&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=abIJRPgnrcM:hnfuqfbMNdM:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=abIJRPgnrcM:hnfuqfbMNdM:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=abIJRPgnrcM:hnfuqfbMNdM:XQ266DUsA9M"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=XQ266DUsA9M" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=abIJRPgnrcM:hnfuqfbMNdM:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=abIJRPgnrcM:hnfuqfbMNdM:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=abIJRPgnrcM:hnfuqfbMNdM:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=abIJRPgnrcM:hnfuqfbMNdM:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=abIJRPgnrcM:hnfuqfbMNdM:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=abIJRPgnrcM:hnfuqfbMNdM:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=abIJRPgnrcM:hnfuqfbMNdM:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotNetTipOfTheDay/~4/abIJRPgnrcM" height="1" width="1"/&gt;</description>
      <guid isPermaLink="false">http://dotnettipoftheday.org/tips/how-to-respond-with-code-404-not-found-in-aspnet.aspx</guid>
      <pubDate>Tue, 26 Aug 2008 20:46:47 GMT</pubDate>
      <wfw:commentRss>http://dotnettipoftheday.org/tips/CommentsRss.aspx?tipid=how-to-respond-with-code-404-not-found-in-aspnet</wfw:commentRss>
    <link>http://feedproxy.google.com/~r/dotNetTipOfTheDay/~3/abIJRPgnrcM/how-to-respond-with-code-404-not-found-in-aspnet.aspx</link><feedburner:origLink>http://dotnettipoftheday.org/tips/how-to-respond-with-code-404-not-found-in-aspnet.aspx</feedburner:origLink></item>
    <item>
      <title>Code snippets for some common operations with exceptions</title>
      <description>&lt;p&gt;Download and install these additional code snippets for common operations with exceptions. To use them type shortcut for&amp;nbsp;the code snippet that you want to&amp;nbsp;add to your code&amp;nbsp;and then&amp;nbsp;type Tab, Tab to invoke it.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://www.gotcodesnippets.com/1132.snippet"&gt;thr&lt;/a&gt; - throw new&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.gotcodesnippets.com/1134.snippet"&gt;thrni&lt;/a&gt; - throw new NotImplementedException("");&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=code-snippets-for-some-common-operations-with-exceptions"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=code-snippets-for-some-common-operations-with-exceptions" border="0"/&gt;&lt;/a&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=9sLo9LBeJbs:xNC1ZLVjpkk:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=9sLo9LBeJbs:xNC1ZLVjpkk:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=9sLo9LBeJbs:xNC1ZLVjpkk:XQ266DUsA9M"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=XQ266DUsA9M" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=9sLo9LBeJbs:xNC1ZLVjpkk:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=9sLo9LBeJbs:xNC1ZLVjpkk:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=9sLo9LBeJbs:xNC1ZLVjpkk:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=9sLo9LBeJbs:xNC1ZLVjpkk:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=9sLo9LBeJbs:xNC1ZLVjpkk:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=9sLo9LBeJbs:xNC1ZLVjpkk:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=9sLo9LBeJbs:xNC1ZLVjpkk:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotNetTipOfTheDay/~4/9sLo9LBeJbs" height="1" width="1"/&gt;</description>
      <guid isPermaLink="false">http://dotnettipoftheday.org/tips/code-snippets-for-some-common-operations-with-exceptions.aspx</guid>
      <pubDate>Mon, 19 May 2008 08:47:41 GMT</pubDate>
      <wfw:commentRss>http://dotnettipoftheday.org/tips/CommentsRss.aspx?tipid=code-snippets-for-some-common-operations-with-exceptions</wfw:commentRss>
    <link>http://feedproxy.google.com/~r/dotNetTipOfTheDay/~3/9sLo9LBeJbs/code-snippets-for-some-common-operations-with-exceptions.aspx</link><feedburner:origLink>http://dotnettipoftheday.org/tips/code-snippets-for-some-common-operations-with-exceptions.aspx</feedburner:origLink></item>
    <item>
      <title>Send an e-mail any time an unhandled exception occurs</title>
      <description>&lt;p&gt;Consider using built-in &lt;a href="http://msdn.microsoft.com/en-us/library/ms178703.aspx"&gt;ASP.NET health monitoring&lt;/a&gt; to monitor your website. Especially if you are not monitoring it at all yet.&amp;nbsp;ASP.NET health monitoring contains ready-to-use &lt;a href="http://msdn.microsoft.com/en-us/library/ms178703.aspx#web_events"&gt;Web health-monitoring events&lt;/a&gt; classes (Web events) and health-monitoring providers (listeners). For example, you can easily configure it to&amp;nbsp;&lt;a href="http://msdn.microsoft.com/en-us/library/ms227553.aspx"&gt;send an email any time an error is detected&lt;/a&gt;.&lt;/p&gt;&lt;br /&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=send-an-e-mail-any-time-an-unhandled-exception-occurs"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=send-an-e-mail-any-time-an-unhandled-exception-occurs" border="0"/&gt;&lt;/a&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=-k5Jhb_-eUY:g3Zwcf9D_Xg:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=-k5Jhb_-eUY:g3Zwcf9D_Xg:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=-k5Jhb_-eUY:g3Zwcf9D_Xg:XQ266DUsA9M"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=XQ266DUsA9M" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=-k5Jhb_-eUY:g3Zwcf9D_Xg:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=-k5Jhb_-eUY:g3Zwcf9D_Xg:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=-k5Jhb_-eUY:g3Zwcf9D_Xg:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=-k5Jhb_-eUY:g3Zwcf9D_Xg:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=-k5Jhb_-eUY:g3Zwcf9D_Xg:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=-k5Jhb_-eUY:g3Zwcf9D_Xg:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=-k5Jhb_-eUY:g3Zwcf9D_Xg:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotNetTipOfTheDay/~4/-k5Jhb_-eUY" height="1" width="1"/&gt;</description>
      <guid isPermaLink="false">http://dotnettipoftheday.org/tips/send-an-e-mail-any-time-an-unhandled-exception-occurs.aspx</guid>
      <pubDate>Sat, 10 May 2008 14:06:58 GMT</pubDate>
      <wfw:commentRss>http://dotnettipoftheday.org/tips/CommentsRss.aspx?tipid=send-an-e-mail-any-time-an-unhandled-exception-occurs</wfw:commentRss>
    <link>http://feedproxy.google.com/~r/dotNetTipOfTheDay/~3/-k5Jhb_-eUY/send-an-e-mail-any-time-an-unhandled-exception-occurs.aspx</link><feedburner:origLink>http://dotnettipoftheday.org/tips/send-an-e-mail-any-time-an-unhandled-exception-occurs.aspx</feedburner:origLink></item>
    <item>
      <title>News: .NET Tips &amp;amp; Tricks Community RSS</title>
      <description>&lt;p&gt;Those who prefer reading this site through RSS now can also &lt;a href="http://feeds.dotnettipoftheday.org/netTipsTricksCommunity"&gt;subscribe&lt;/a&gt; for updates to .NET Tips &amp; Tricks Community.&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=PUCvv_1Ve4Y:fuLS8u9O-iY:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=PUCvv_1Ve4Y:fuLS8u9O-iY:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=PUCvv_1Ve4Y:fuLS8u9O-iY:XQ266DUsA9M"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=XQ266DUsA9M" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=PUCvv_1Ve4Y:fuLS8u9O-iY:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=PUCvv_1Ve4Y:fuLS8u9O-iY:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=PUCvv_1Ve4Y:fuLS8u9O-iY:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=PUCvv_1Ve4Y:fuLS8u9O-iY:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=PUCvv_1Ve4Y:fuLS8u9O-iY:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotNetTipOfTheDay/~4/PUCvv_1Ve4Y" height="1" width="1"/&gt;</description>
      <guid isPermaLink="false">http://dotnettipoftheday.org/news.aspx#2008-05-10</guid>
      <pubDate>Sat, 10 May 2008 15:57:00 GMT</pubDate>
    <link>http://feedproxy.google.com/~r/dotNetTipOfTheDay/~3/PUCvv_1Ve4Y/news.aspx</link><feedburner:origLink>http://dotnettipoftheday.org/news.aspx#2008-05-10</feedburner:origLink></item>
    <item>
      <title>News: Why does new tips appear on this site so infrequently?</title>
      <description>&lt;p&gt;Hi guys. I know some of you are not satisfied with the frequency new tips appear on this site. The last comment I received was a proposal to rename the site to .NET Tip of The Month :) But I don't want to do this because I'm going to fix this problem. I'm working on the &lt;a href="http://dotnettipoftheday.org/community/"&gt;.NET Tips &amp; Tricks Community&lt;/a&gt; section now. My tips that are too small to hit the front page were added to this section. It's the place where all of you can share your .NET tips and tricks.&lt;/p&gt;&lt;p&gt;It's clear that this section lacks for some features. And if anyone out of 2510 subscribers has a proposal, just drop me a line. My email is &lt;a href="mailto:kostya.ly@gmail.com"&gt;kostya.ly@gmail.com&lt;/a&gt;.&lt;/p&gt;&lt;p&gt;Thanks for you patience.&lt;br /&gt;Kostya Ly&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=TtKHHAgjlTM:Yf1A5WePhvQ:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=TtKHHAgjlTM:Yf1A5WePhvQ:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=TtKHHAgjlTM:Yf1A5WePhvQ:XQ266DUsA9M"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=XQ266DUsA9M" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=TtKHHAgjlTM:Yf1A5WePhvQ:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=TtKHHAgjlTM:Yf1A5WePhvQ:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=TtKHHAgjlTM:Yf1A5WePhvQ:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=TtKHHAgjlTM:Yf1A5WePhvQ:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=TtKHHAgjlTM:Yf1A5WePhvQ:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotNetTipOfTheDay/~4/TtKHHAgjlTM" height="1" width="1"/&gt;</description>
      <guid isPermaLink="false">http://dotnettipoftheday.org/news.aspx#2008-05-08</guid>
      <pubDate>Thu, 08 May 2008 00:48:00 GMT</pubDate>
    <link>http://feedproxy.google.com/~r/dotNetTipOfTheDay/~3/TtKHHAgjlTM/news.aspx</link><feedburner:origLink>http://dotnettipoftheday.org/news.aspx#2008-05-08</feedburner:origLink></item>
    <item>
      <title>Turn off Session State if you're not using it</title>
      <description>&lt;p&gt;Since&amp;nbsp;ASP.NET Session State&amp;nbsp;is on by default, you pay the cost in memory even if you don't use it. If you're not using Session State, turn it off and save yourself the overhead. There are serveral ways to do this:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;If you're not using Session State at all, turn it off completely&amp;nbsp;via&amp;nbsp;web.config file:&lt;br /&gt;&lt;br /&gt;
&lt;div style="font-family: Courier New; font-size: 10pt; color: black; background: white; text-align:left;"&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;system.web&lt;/span&gt;&amp;gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;sessionState&lt;/span&gt; &lt;span style="color: #ff0000;"&gt;mode&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;=&lt;/span&gt;"&lt;span style="color: #0000ff;"&gt;Off&lt;/span&gt;"&lt;span style="color: #0000ff;"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #a31515;"&gt;sessionState&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;/p&gt;
&lt;/div&gt;
&lt;br /&gt;&lt;/li&gt;
&lt;li&gt;If&amp;nbsp;you're using Session State, but&amp;nbsp;it's required&amp;nbsp;only&amp;nbsp;for&amp;nbsp;a few pages, then first&amp;nbsp;turn it off for all pages:&lt;br /&gt;&lt;br /&gt;
&lt;div style="font-family: Courier New; font-size: 10pt; color: black; background: white; text-align:left;"&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;system.web&lt;/span&gt;&amp;gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #0000ff;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;pages&lt;/span&gt; &lt;span style="color: #ff0000;"&gt;enableSessionState&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;=&lt;/span&gt;"&lt;span style="color: #0000ff;"&gt;false&lt;/span&gt;"&lt;span style="color: #0000ff;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;/p&gt;
&lt;/div&gt;
&lt;br /&gt;then&amp;nbsp;enable it for&amp;nbsp;a specific page:&lt;br /&gt;&lt;br /&gt;
&lt;div style="font-family: Courier New; font-size: 10pt; color: black; background: white; text-align:left;"&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="background-color:yellow"&gt;&amp;lt;%&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;@ &lt;/span&gt;&lt;span style="color: #a31515;"&gt;Page&lt;/span&gt; ... &lt;span style="color: #ff0000;"&gt;EnableSessionState&lt;/span&gt;&lt;span style="color: #0000ff;"&gt;="true"&lt;/span&gt; &lt;span style="background-color:yellow"&gt;%&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;P.S. obviously&amp;nbsp;such&amp;nbsp;optimization makes sense only for high-traffic web sites.&lt;/p&gt;&lt;br /&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=page-enabledsessionstate"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=page-enabledsessionstate" border="0"/&gt;&lt;/a&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=ToYuxorHOow:zprJ_301p3I:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=ToYuxorHOow:zprJ_301p3I:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=ToYuxorHOow:zprJ_301p3I:XQ266DUsA9M"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=XQ266DUsA9M" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=ToYuxorHOow:zprJ_301p3I:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=ToYuxorHOow:zprJ_301p3I:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=ToYuxorHOow:zprJ_301p3I:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=ToYuxorHOow:zprJ_301p3I:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=ToYuxorHOow:zprJ_301p3I:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=ToYuxorHOow:zprJ_301p3I:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=ToYuxorHOow:zprJ_301p3I:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotNetTipOfTheDay/~4/ToYuxorHOow" height="1" width="1"/&gt;</description>
      <guid isPermaLink="false">http://dotnettipoftheday.org/tips/page-enabledsessionstate.aspx</guid>
      <pubDate>Thu, 01 May 2008 23:51:00 GMT</pubDate>
      <wfw:commentRss>http://dotnettipoftheday.org/tips/CommentsRss.aspx?tipid=page-enabledsessionstate</wfw:commentRss>
    <link>http://feedproxy.google.com/~r/dotNetTipOfTheDay/~3/ToYuxorHOow/page-enabledsessionstate.aspx</link><feedburner:origLink>http://dotnettipoftheday.org/tips/page-enabledsessionstate.aspx</feedburner:origLink></item>
    <item>
      <title>How to debug Windows Service startup</title>
      <description>&lt;p&gt;Actually you can use this trick every time when:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;You want to debug a process startup.&lt;/li&gt;
&lt;li&gt;You can't run&amp;nbsp;the process&amp;nbsp;by hitting F5 in Visual Studio (for example,&amp;nbsp;Windows Service).&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;So the problem is that you can't simply attach the Visual Studio debugger to the process as there isn't one to attach to until after you&amp;nbsp;start the process. However, once you start the process&amp;nbsp;if you have a bug such as an exception in the process's initialization you won't get the debugger attached to the process before it's too late.&lt;/p&gt;
&lt;p&gt;Calling&amp;nbsp;&lt;a href="http://msdn2.microsoft.com/en-us/library/system.diagnostics.debugger.launch.aspx"&gt;Debugger.Launch()&lt;/a&gt; or &lt;a href="http://msdn2.microsoft.com/en-us/library/system.diagnostics.debugger.break.aspx"&gt;Debugger.Break()&lt;/a&gt; in your code allow you to debug such&amp;nbsp;problems. This&amp;nbsp;methods pop up the following screen asking you which instance of the debugger it should use to&amp;nbsp;debug the application.&lt;/p&gt;
&lt;div style="text-align:center"&gt;&lt;img src="http://dotnettipoftheday.org/resources/jit-debugger.png" alt="JIT Debugger" /&gt;&lt;/div&gt;&lt;br /&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=how-to-debug-windows-service-startup"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=how-to-debug-windows-service-startup" border="0"/&gt;&lt;/a&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=mfgc8xToEJk:E8GfBvI0lws:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=mfgc8xToEJk:E8GfBvI0lws:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=mfgc8xToEJk:E8GfBvI0lws:XQ266DUsA9M"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=XQ266DUsA9M" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=mfgc8xToEJk:E8GfBvI0lws:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=mfgc8xToEJk:E8GfBvI0lws:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=mfgc8xToEJk:E8GfBvI0lws:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=mfgc8xToEJk:E8GfBvI0lws:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=mfgc8xToEJk:E8GfBvI0lws:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=mfgc8xToEJk:E8GfBvI0lws:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=mfgc8xToEJk:E8GfBvI0lws:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotNetTipOfTheDay/~4/mfgc8xToEJk" height="1" width="1"/&gt;</description>
      <guid isPermaLink="false">http://dotnettipoftheday.org/tips/how-to-debug-windows-service-startup.aspx</guid>
      <pubDate>Wed, 16 Apr 2008 22:05:00 GMT</pubDate>
      <wfw:commentRss>http://dotnettipoftheday.org/tips/CommentsRss.aspx?tipid=how-to-debug-windows-service-startup</wfw:commentRss>
    <link>http://feedproxy.google.com/~r/dotNetTipOfTheDay/~3/mfgc8xToEJk/how-to-debug-windows-service-startup.aspx</link><feedburner:origLink>http://dotnettipoftheday.org/tips/how-to-debug-windows-service-startup.aspx</feedburner:origLink></item>
    <item>
      <title>How to change HTML markup produced by ASP.NET controls</title>
      <description>&lt;p&gt;There are at least two ways of changing HTML markup produced by standard&amp;nbsp;ASP.NET controls. The most obvious&amp;nbsp;one is to derive a new class based on an existing ASP.NET control class and override the necessary rendering methods.&lt;/p&gt;
&lt;p&gt;Another option that is worth considering is to write a small&amp;nbsp;&lt;a href="http://msdn2.microsoft.com/en-us/library/67276kc5.aspx"&gt;control adapter&lt;/a&gt; for&amp;nbsp;the existing ASP.NET control. This&amp;nbsp;is a&amp;nbsp;little chunk of logic that you add to your web site to effectively "adapt" an ASP.NET control to render the HTML you prefer. This approach&amp;nbsp;has&amp;nbsp;the following two major&amp;nbsp;advantages over custom controls:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;You&amp;nbsp;don't need to add the &lt;strong&gt;@Register&lt;/strong&gt; directives to your pages.&lt;/li&gt;
&lt;li&gt;The ASP.NET framework comes with a built-in means to apply the adapters to just certain browsers. When you build entirely new custom controls you have to write your own logic to handle browser detection to vary the response.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;For example you can use &lt;a href="http://www.asp.net/cssadapters/"&gt;ASP.NET 2.0 CSS Friendly Control Adapters&lt;/a&gt; package to generate CSS friendly markup from some of the more commonly used ASP.NET controls.&lt;/p&gt;&lt;br /&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=how-to-change-aspnet-controls-markup"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=how-to-change-aspnet-controls-markup" border="0"/&gt;&lt;/a&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=hqGCv9guUTQ:t6J4wwP1yLY:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=hqGCv9guUTQ:t6J4wwP1yLY:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=hqGCv9guUTQ:t6J4wwP1yLY:XQ266DUsA9M"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=XQ266DUsA9M" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=hqGCv9guUTQ:t6J4wwP1yLY:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=hqGCv9guUTQ:t6J4wwP1yLY:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=hqGCv9guUTQ:t6J4wwP1yLY:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=hqGCv9guUTQ:t6J4wwP1yLY:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=hqGCv9guUTQ:t6J4wwP1yLY:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=hqGCv9guUTQ:t6J4wwP1yLY:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=hqGCv9guUTQ:t6J4wwP1yLY:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotNetTipOfTheDay/~4/hqGCv9guUTQ" height="1" width="1"/&gt;</description>
      <guid isPermaLink="false">http://dotnettipoftheday.org/tips/how-to-change-aspnet-controls-markup.aspx</guid>
      <pubDate>Wed, 09 Apr 2008 13:07:00 GMT</pubDate>
      <wfw:commentRss>http://dotnettipoftheday.org/tips/CommentsRss.aspx?tipid=how-to-change-aspnet-controls-markup</wfw:commentRss>
    <link>http://feedproxy.google.com/~r/dotNetTipOfTheDay/~3/hqGCv9guUTQ/how-to-change-aspnet-controls-markup.aspx</link><feedburner:origLink>http://dotnettipoftheday.org/tips/how-to-change-aspnet-controls-markup.aspx</feedburner:origLink></item>
    <item>
      <title>Label to a form input field</title>
      <description>&lt;p&gt;If you set a label to a form element set the &lt;a href="http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.label.associatedcontrolid.aspx"&gt;AssociatedControlID&lt;/a&gt; property. This will force the label to render as &amp;lt;label&amp;gt; rather than &amp;lt;span&amp;gt;. A benefit of using the &lt;strong&gt;AssociatedControlID&lt;/strong&gt; property is that clicking a label when this property is set automatically changes the form focus to the associated form input.&lt;/p&gt;&lt;br /&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=label-to-a-form-input-field"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=label-to-a-form-input-field" border="0"/&gt;&lt;/a&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=cWbMu6CB9ZA:g7nF0_R8L1E:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=cWbMu6CB9ZA:g7nF0_R8L1E:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=cWbMu6CB9ZA:g7nF0_R8L1E:XQ266DUsA9M"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=XQ266DUsA9M" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=cWbMu6CB9ZA:g7nF0_R8L1E:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=cWbMu6CB9ZA:g7nF0_R8L1E:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=cWbMu6CB9ZA:g7nF0_R8L1E:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=cWbMu6CB9ZA:g7nF0_R8L1E:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=cWbMu6CB9ZA:g7nF0_R8L1E:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=cWbMu6CB9ZA:g7nF0_R8L1E:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=cWbMu6CB9ZA:g7nF0_R8L1E:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotNetTipOfTheDay/~4/cWbMu6CB9ZA" height="1" width="1"/&gt;</description>
      <guid isPermaLink="false">http://dotnettipoftheday.org/tips/label-to-a-form-input-field.aspx</guid>
      <pubDate>Tue, 01 Apr 2008 23:15:00 GMT</pubDate>
      <wfw:commentRss>http://dotnettipoftheday.org/tips/CommentsRss.aspx?tipid=label-to-a-form-input-field</wfw:commentRss>
    <link>http://feedproxy.google.com/~r/dotNetTipOfTheDay/~3/cWbMu6CB9ZA/label-to-a-form-input-field.aspx</link><feedburner:origLink>http://dotnettipoftheday.org/tips/label-to-a-form-input-field.aspx</feedburner:origLink></item>
    <item>
      <title>News: .NET Tips &amp;amp; Tricks Community (ALPHA)</title>
      <description>&lt;p&gt;Some of you have used "Add a tip" function and submitted one or more tips. Some of these tips are pretty interesting and I publish them on this site. But for someone other submitted tips could be interesting as well. So, from now on, everybody can check out all tips submitted by the visitors of the site in a new section - &lt;a href="http://dotnettipoftheday.org/SuggestedTips.aspx"&gt;.NET Tips &amp; Tricks Community (ALPHA)&lt;/a&gt;. In fact this is not a real community yet (that's why you can see ALPHA in it's name). I'll add some common features soon. Let's see how it goes.&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=194VP84xPsQ:p3y9Xz0CBYY:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=194VP84xPsQ:p3y9Xz0CBYY:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=194VP84xPsQ:p3y9Xz0CBYY:XQ266DUsA9M"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=XQ266DUsA9M" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=194VP84xPsQ:p3y9Xz0CBYY:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=194VP84xPsQ:p3y9Xz0CBYY:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=194VP84xPsQ:p3y9Xz0CBYY:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=194VP84xPsQ:p3y9Xz0CBYY:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=194VP84xPsQ:p3y9Xz0CBYY:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotNetTipOfTheDay/~4/194VP84xPsQ" height="1" width="1"/&gt;</description>
      <guid isPermaLink="false">http://dotnettipoftheday.org/news.aspx#2008-03-24</guid>
      <pubDate>Mon, 24 Mar 2008 00:16:00 GMT</pubDate>
    <link>http://feedproxy.google.com/~r/dotNetTipOfTheDay/~3/194VP84xPsQ/news.aspx</link><feedburner:origLink>http://dotnettipoftheday.org/news.aspx#2008-03-24</feedburner:origLink></item>
    <item>
      <title>Add Windows Explorer to your Visual Studio tools menu</title>
      <description>&lt;p&gt;I often need to open Windows Explorer and browse to the current file, folder, or project that I am working on in Visual Studio.&amp;nbsp;This tip allows you to achieve this by clicking "Windows Explorer" in the Tools menu, and is one of the most simple-yet-useful tips I know of.&lt;/p&gt;
&lt;p&gt;To set it up, click &lt;strong&gt;Tools&lt;/strong&gt;, then &lt;strong&gt;External Tools...&lt;/strong&gt;, then click &lt;strong&gt;Add&lt;/strong&gt;.&amp;nbsp; Now enter the following data:&lt;br /&gt;Title: Windows Explorer&lt;br /&gt;Command: explorer.exe&lt;br /&gt;Arguments: /select,"$(ItemPath)"&lt;/p&gt;
&lt;p&gt;Leave &lt;strong&gt;Initial directoy&lt;/strong&gt; blank, and click &lt;strong&gt;OK&lt;/strong&gt;.&amp;nbsp; Now when you click &lt;strong&gt;Tools&lt;/strong&gt;, &lt;strong&gt;Windows Explorer&lt;/strong&gt;, Windows Explorer will open with the current file you are editing selected.&lt;/p&gt;
&lt;p style="margin-top:20px; font-style:italic;"&gt;submitted by &lt;a href="http://www.picwa.com"&gt;Daniel Flower&lt;/a&gt;&lt;/p&gt;&lt;br /&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=explorer-in-tools-menu"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=explorer-in-tools-menu" border="0"/&gt;&lt;/a&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=OwhxJ-kgBDs:gxngkQVdQTg:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=OwhxJ-kgBDs:gxngkQVdQTg:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=OwhxJ-kgBDs:gxngkQVdQTg:XQ266DUsA9M"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=XQ266DUsA9M" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=OwhxJ-kgBDs:gxngkQVdQTg:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=OwhxJ-kgBDs:gxngkQVdQTg:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=OwhxJ-kgBDs:gxngkQVdQTg:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=OwhxJ-kgBDs:gxngkQVdQTg:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=OwhxJ-kgBDs:gxngkQVdQTg:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=OwhxJ-kgBDs:gxngkQVdQTg:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=OwhxJ-kgBDs:gxngkQVdQTg:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotNetTipOfTheDay/~4/OwhxJ-kgBDs" height="1" width="1"/&gt;</description>
      <guid isPermaLink="false">http://dotnettipoftheday.org/tips/explorer-in-tools-menu.aspx</guid>
      <pubDate>Mon, 17 Mar 2008 18:15:00 GMT</pubDate>
      <wfw:commentRss>http://dotnettipoftheday.org/tips/CommentsRss.aspx?tipid=explorer-in-tools-menu</wfw:commentRss>
    <link>http://feedproxy.google.com/~r/dotNetTipOfTheDay/~3/OwhxJ-kgBDs/explorer-in-tools-menu.aspx</link><feedburner:origLink>http://dotnettipoftheday.org/tips/explorer-in-tools-menu.aspx</feedburner:origLink></item>
    <item>
      <title>Correct event invocation</title>
      <description>&lt;p&gt;Be aware that if&amp;nbsp;there are no subscribers&amp;nbsp;a .NET&amp;nbsp;event will be null. Therefore when raising the event from C#&amp;nbsp;test it for null first.&lt;/p&gt;
&lt;div style="font-size: 10pt; background: white; color: black; font-family: Courier New;"&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #0000ff;"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff;"&gt;event&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;EventHandler&lt;/span&gt; SelectedNodeChanged;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #0000ff;"&gt;protected&lt;/span&gt; &lt;span style="color: #0000ff;"&gt;virtual&lt;/span&gt; &lt;span style="color: #0000ff;"&gt;void&lt;/span&gt; OnSelectedNodeChanged(&lt;span style="color: #0000ff;"&gt;object&lt;/span&gt; sender, &lt;span style="color: #2b91af;"&gt;EventArgs&lt;/span&gt; e)&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #008000;"&gt;//Event will be null if there are no subscribers&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #0000ff;"&gt;if&lt;/span&gt; (SelectedNodeChanged != &lt;span style="color: #0000ff;"&gt;null&lt;/span&gt;)&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; SelectedNodeChanged(&lt;span style="color: #0000ff;"&gt;this&lt;/span&gt;, e);&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;However in multithreaded application the last subscriber can unsubscribe immediately after the null check and before the event is raised. To avoid a&amp;nbsp;null reference exception make a temporary copy of the event.&lt;/p&gt;
&lt;div style="font-size: 10pt; background: white; color: black; font-family: Courier New;"&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #0000ff;"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff;"&gt;event&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;EventHandler&lt;/span&gt; SelectedNodeChanged;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #0000ff;"&gt;protected&lt;/span&gt; &lt;span style="color: #0000ff;"&gt;virtual&lt;/span&gt; &lt;span style="color: #0000ff;"&gt;void&lt;/span&gt; OnSelectedNodeChanged(&lt;span style="color: #0000ff;"&gt;object&lt;/span&gt; sender, &lt;span style="color: #2b91af;"&gt;EventArgs&lt;/span&gt; e)&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #008000;"&gt;//Make a temporary copy of the event to avoid possibility of&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #008000;"&gt;//a race condition if the last subscriber unsubscribes&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #008000;"&gt;//immediately after the null check and before the event is raised.&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #2b91af;"&gt;EventHandler&lt;/span&gt; handler = SelectedNodeChanged;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #008000;"&gt;//Event will be null if there are no subscribers&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #0000ff;"&gt;if&lt;/span&gt; (handler != &lt;span style="color: #0000ff;"&gt;null&lt;/span&gt;)&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; handler(&lt;span style="color: #0000ff;"&gt;this&lt;/span&gt;, e);&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;/div&gt;
&lt;p style="margin-top:20px; font-style:italic"&gt;submitted by &lt;a href="http://www.godevs.com"&gt;Sergey P.&lt;/a&gt;&lt;/p&gt;&lt;br /&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=correct-event-invocation"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=correct-event-invocation" border="0"/&gt;&lt;/a&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=wSwqgZG5jIo:HzwBh0HLmcw:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=wSwqgZG5jIo:HzwBh0HLmcw:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=wSwqgZG5jIo:HzwBh0HLmcw:XQ266DUsA9M"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=XQ266DUsA9M" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=wSwqgZG5jIo:HzwBh0HLmcw:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=wSwqgZG5jIo:HzwBh0HLmcw:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=wSwqgZG5jIo:HzwBh0HLmcw:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=wSwqgZG5jIo:HzwBh0HLmcw:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=wSwqgZG5jIo:HzwBh0HLmcw:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=wSwqgZG5jIo:HzwBh0HLmcw:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=wSwqgZG5jIo:HzwBh0HLmcw:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotNetTipOfTheDay/~4/wSwqgZG5jIo" height="1" width="1"/&gt;</description>
      <guid isPermaLink="false">http://dotnettipoftheday.org/tips/correct-event-invocation.aspx</guid>
      <pubDate>Sat, 01 Mar 2008 18:18:00 GMT</pubDate>
      <wfw:commentRss>http://dotnettipoftheday.org/tips/CommentsRss.aspx?tipid=correct-event-invocation</wfw:commentRss>
    <link>http://feedproxy.google.com/~r/dotNetTipOfTheDay/~3/wSwqgZG5jIo/correct-event-invocation.aspx</link><feedburner:origLink>http://dotnettipoftheday.org/tips/correct-event-invocation.aspx</feedburner:origLink></item>
    <item>
      <title>How to view code that is covered by the IntelliSense pop-up</title>
      <description>&lt;p&gt;When working in Visual Studio 2008 and the&amp;nbsp;IntelliSense pop-up is visible, but you would like to view&amp;nbsp;the code that is covered by it, press and hold the &lt;strong&gt;Ctrl&lt;/strong&gt; key, and the pop-up becomes transparent so that you can view the code that is below the pop-up.&lt;/p&gt;
&lt;p&gt;&lt;img src="http://dotnettipoftheday.org/resources/intellisense-opacity.png" alt="" /&gt;&lt;/p&gt;&lt;br /&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=intellisense-opacity"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=intellisense-opacity" border="0"/&gt;&lt;/a&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=zLESZK9xIdU:hNElEGzlqzA:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=zLESZK9xIdU:hNElEGzlqzA:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=zLESZK9xIdU:hNElEGzlqzA:XQ266DUsA9M"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=XQ266DUsA9M" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=zLESZK9xIdU:hNElEGzlqzA:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=zLESZK9xIdU:hNElEGzlqzA:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=zLESZK9xIdU:hNElEGzlqzA:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=zLESZK9xIdU:hNElEGzlqzA:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=zLESZK9xIdU:hNElEGzlqzA:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=zLESZK9xIdU:hNElEGzlqzA:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=zLESZK9xIdU:hNElEGzlqzA:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotNetTipOfTheDay/~4/zLESZK9xIdU" height="1" width="1"/&gt;</description>
      <guid isPermaLink="false">http://dotnettipoftheday.org/tips/intellisense-opacity.aspx</guid>
      <pubDate>Fri, 22 Feb 2008 12:56:00 GMT</pubDate>
      <wfw:commentRss>http://dotnettipoftheday.org/tips/CommentsRss.aspx?tipid=intellisense-opacity</wfw:commentRss>
    <link>http://feedproxy.google.com/~r/dotNetTipOfTheDay/~3/zLESZK9xIdU/intellisense-opacity.aspx</link><feedburner:origLink>http://dotnettipoftheday.org/tips/intellisense-opacity.aspx</feedburner:origLink></item>
    <item>
      <title>When returning DataReader from a function, specify CommandBehavior.CloseConnection</title>
      <description>&lt;p&gt;When you create an ADO.NET &lt;strong&gt;DataReader&lt;/strong&gt; object, specify the &lt;strong&gt;CommandBehavior.CloseConnection&lt;/strong&gt; enumeration in your call to &lt;strong&gt;ExecuteReader&lt;/strong&gt;. This ensures that when you close the &lt;strong&gt;DataReader&lt;/strong&gt;, the SQL connection is also closed. This is especially helpful when you return a &lt;strong&gt;DataReader&lt;/strong&gt; from a function, and you do not have control over the calling code. If the caller forgets to close the connection but closes the reader, both are closed when the &lt;strong&gt;DataReader&lt;/strong&gt; is created by using &lt;strong&gt;CommandBehavior.CloseConnection&lt;/strong&gt;. This is shown in the following code fragment.&lt;/p&gt;

&lt;div style="font-family: Courier New; font-size: 10pt; color: black; background: white;"&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;SqlDataReader&lt;/span&gt; CustomerRead(&lt;span style="color: blue;"&gt;int&lt;/span&gt; CustomerID)&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: green;"&gt;//... create connection and command, open connection&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;return&lt;/span&gt; myCommand.ExecuteReader(&lt;span style="color: #2b91af;"&gt;CommandBehavior&lt;/span&gt;.CloseConnection);&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: green;"&gt;//... client code&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #2b91af;"&gt;SqlDataReader&lt;/span&gt; myReader = CustomerRead(10248);&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: green;"&gt;//... read some data&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; myReader.Close(); &lt;span style="color: green;"&gt;// reader and connection are closed&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;br /&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=datareader-closeconnection"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=datareader-closeconnection" border="0"/&gt;&lt;/a&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=9pGnK4Hxqjw:PWQzXFvn2nE:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=9pGnK4Hxqjw:PWQzXFvn2nE:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=9pGnK4Hxqjw:PWQzXFvn2nE:XQ266DUsA9M"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=XQ266DUsA9M" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=9pGnK4Hxqjw:PWQzXFvn2nE:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=9pGnK4Hxqjw:PWQzXFvn2nE:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=9pGnK4Hxqjw:PWQzXFvn2nE:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=9pGnK4Hxqjw:PWQzXFvn2nE:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=9pGnK4Hxqjw:PWQzXFvn2nE:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=9pGnK4Hxqjw:PWQzXFvn2nE:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=9pGnK4Hxqjw:PWQzXFvn2nE:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotNetTipOfTheDay/~4/9pGnK4Hxqjw" height="1" width="1"/&gt;</description>
      <guid isPermaLink="false">http://dotnettipoftheday.org/tips/datareader-closeconnection.aspx</guid>
      <pubDate>Sat, 16 Feb 2008 15:30:00 GMT</pubDate>
      <wfw:commentRss>http://dotnettipoftheday.org/tips/CommentsRss.aspx?tipid=datareader-closeconnection</wfw:commentRss>
    <link>http://feedproxy.google.com/~r/dotNetTipOfTheDay/~3/9pGnK4Hxqjw/datareader-closeconnection.aspx</link><feedburner:origLink>http://dotnettipoftheday.org/tips/datareader-closeconnection.aspx</feedburner:origLink></item>
    <item>
      <title>Use explicit casting instead of DataBinder.Eval</title>
      <description>&lt;p&gt;The &lt;a href="http://msdn2.microsoft.com/en-us/library/4hx47hfe.aspx"&gt;DataBinder.Eval&lt;/a&gt; method uses .NET reflection to evaluate the arguments that are passed in and to return the results. Consider limiting the use of DataBinder.Eval during data binding operations in order to improve ASP.NET page performance.&lt;/p&gt;
&lt;p&gt;Consider the following ItemTemplate element within a Repeater control using DataBinder.Eval:&lt;/p&gt;

&lt;div style="font-family: Courier New; font-size: 10pt; color: black; background: white;"&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;ItemTemplate&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;tr&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;td&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="background-color:yellow"&gt;&amp;lt;%&lt;/span&gt;&lt;span style="color:blue"&gt;#&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;DataBinder&lt;/span&gt;.Eval(Container.DataItem, &lt;span style="color:#a31515;"&gt;"field1"&lt;/span&gt;) &lt;span style="background-color:yellow"&gt;%&amp;gt;&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;td&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;td&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="background-color:yellow"&gt;&amp;lt;%&lt;/span&gt;&lt;span style="color:blue"&gt;#&lt;/span&gt; &lt;span style="color:#2b91af;"&gt;DataBinder&lt;/span&gt;.Eval(Container.DataItem, &lt;span style="color:#a31515;"&gt;"field2"&lt;/span&gt;) &lt;span style="background-color:yellow"&gt;%&amp;gt;&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;td&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;tr&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;ItemTemplate&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Using explicit casting offers better performance by avoiding the cost of .NET reflection. Cast the Container.DataItem as a DataRowView:&lt;/p&gt;

&lt;div style="font-family: Courier New; font-size: 10pt; color: black; background: white;"&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;ItemTemplate&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;tr&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;td&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="background-color:yellow"&gt;&amp;lt;%&lt;/span&gt;&lt;span style="color:blue"&gt;#&lt;/span&gt; ((&lt;span style="color:#2b91af;"&gt;DataRowView&lt;/span&gt;)Container.DataItem)[&lt;span style="color:#a31515;"&gt;"field1"&lt;/span&gt;] &lt;span style="background-color:yellow"&gt;%&amp;gt;&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;td&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;td&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;span style="background-color:yellow"&gt;&amp;lt;%&lt;/span&gt;&lt;span style="color:blue"&gt;#&lt;/span&gt; ((&lt;span style="color:#2b91af;"&gt;DataRowView&lt;/span&gt;)Container.DataItem)[&lt;span style="color:#a31515;"&gt;"field2"&lt;/span&gt;] &lt;span style="background-color:yellow"&gt;%&amp;gt;&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515;"&gt;td&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;tr&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;ItemTemplate&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;br /&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=use-explicit-casting-instead-of-databinder.eval"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=use-explicit-casting-instead-of-databinder.eval" border="0"/&gt;&lt;/a&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=Pe0KQU8fJrk:KaPevAy0iQ4:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=Pe0KQU8fJrk:KaPevAy0iQ4:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=Pe0KQU8fJrk:KaPevAy0iQ4:XQ266DUsA9M"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=XQ266DUsA9M" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=Pe0KQU8fJrk:KaPevAy0iQ4:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=Pe0KQU8fJrk:KaPevAy0iQ4:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=Pe0KQU8fJrk:KaPevAy0iQ4:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=Pe0KQU8fJrk:KaPevAy0iQ4:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=Pe0KQU8fJrk:KaPevAy0iQ4:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=Pe0KQU8fJrk:KaPevAy0iQ4:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=Pe0KQU8fJrk:KaPevAy0iQ4:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotNetTipOfTheDay/~4/Pe0KQU8fJrk" height="1" width="1"/&gt;</description>
      <guid isPermaLink="false">http://dotnettipoftheday.org/tips/use-explicit-casting-instead-of-databinder.eval.aspx</guid>
      <pubDate>Tue, 12 Feb 2008 21:42:00 GMT</pubDate>
      <wfw:commentRss>http://dotnettipoftheday.org/tips/CommentsRss.aspx?tipid=use-explicit-casting-instead-of-databinder.eval</wfw:commentRss>
    <link>http://feedproxy.google.com/~r/dotNetTipOfTheDay/~3/Pe0KQU8fJrk/use-explicit-casting-instead-of-databinder.eval.aspx</link><feedburner:origLink>http://dotnettipoftheday.org/tips/use-explicit-casting-instead-of-databinder.eval.aspx</feedburner:origLink></item>
    <item>
      <title>Consider using weak references for your custom caching solutions</title>
      <description>&lt;p&gt;Consider using &lt;a href="http://msdn2.microsoft.com/en-us/library/system.weakreference.aspx"&gt;weak references&lt;/a&gt; when you implement a custom caching solution, so that cached objects can be released by garbage collection when there is memory pressure. You should use weak references mostly for objects that are not small in size because the weak referencing itself involves some overhead. They are suitable for medium to large-sized objects stored in a collection.&lt;/p&gt;&lt;br /&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=weak-reference"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=weak-reference" border="0"/&gt;&lt;/a&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=1S56wywOa28:CS2UbYzBatI:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=1S56wywOa28:CS2UbYzBatI:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=1S56wywOa28:CS2UbYzBatI:XQ266DUsA9M"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=XQ266DUsA9M" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=1S56wywOa28:CS2UbYzBatI:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=1S56wywOa28:CS2UbYzBatI:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=1S56wywOa28:CS2UbYzBatI:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=1S56wywOa28:CS2UbYzBatI:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=1S56wywOa28:CS2UbYzBatI:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=1S56wywOa28:CS2UbYzBatI:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=1S56wywOa28:CS2UbYzBatI:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotNetTipOfTheDay/~4/1S56wywOa28" height="1" width="1"/&gt;</description>
      <guid isPermaLink="false">http://dotnettipoftheday.org/tips/weak-reference.aspx</guid>
      <pubDate>Wed, 06 Feb 2008 21:51:00 GMT</pubDate>
      <wfw:commentRss>http://dotnettipoftheday.org/tips/CommentsRss.aspx?tipid=weak-reference</wfw:commentRss>
    <link>http://feedproxy.google.com/~r/dotNetTipOfTheDay/~3/1S56wywOa28/weak-reference.aspx</link><feedburner:origLink>http://dotnettipoftheday.org/tips/weak-reference.aspx</feedburner:origLink></item>
    <item>
      <title>Automatically insert attribute value quotes</title>
      <description>&lt;p&gt;Visual Studio HTML/ASPX editor can save you some time if you enable option &lt;strong&gt;Tools | Options... | Text Editor | HTML | Format | Insert attribute value quotes when typing&lt;/strong&gt;. When this option is enabled, once you type a name of an attribute and following "=" symbol, Visual Studio automatically inserts a pair of quotes and invokes IntelliSense menu. After that you need only to select an attribute value from the menu and hit the Enter button. It's another nice timesaver.&lt;/p&gt;
&lt;img src="http://bdv.bidvertiser.com/bidvertiser/images/rss/pixel.gif?bdv_ver_code=BDV-664839-BDV" style="width:1px; height:1px" alt="" /&gt;&lt;br /&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=automatic-attribute-quotes-visual-studio"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=automatic-attribute-quotes-visual-studio" border="0"/&gt;&lt;/a&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=w-QVGKmNEow:kmdmb7OnSJY:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=w-QVGKmNEow:kmdmb7OnSJY:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=w-QVGKmNEow:kmdmb7OnSJY:XQ266DUsA9M"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=XQ266DUsA9M" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=w-QVGKmNEow:kmdmb7OnSJY:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=w-QVGKmNEow:kmdmb7OnSJY:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=w-QVGKmNEow:kmdmb7OnSJY:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=w-QVGKmNEow:kmdmb7OnSJY:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=w-QVGKmNEow:kmdmb7OnSJY:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=w-QVGKmNEow:kmdmb7OnSJY:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=w-QVGKmNEow:kmdmb7OnSJY:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotNetTipOfTheDay/~4/w-QVGKmNEow" height="1" width="1"/&gt;</description>
      <guid isPermaLink="false">http://dotnettipoftheday.org/tips/automatic-attribute-quotes-visual-studio.aspx</guid>
      <pubDate>Mon, 04 Feb 2008 20:50:00 GMT</pubDate>
      <wfw:commentRss>http://dotnettipoftheday.org/tips/CommentsRss.aspx?tipid=automatic-attribute-quotes-visual-studio</wfw:commentRss>
    <link>http://feedproxy.google.com/~r/dotNetTipOfTheDay/~3/w-QVGKmNEow/automatic-attribute-quotes-visual-studio.aspx</link><feedburner:origLink>http://dotnettipoftheday.org/tips/automatic-attribute-quotes-visual-studio.aspx</feedburner:origLink></item>
    <item>
      <title>Correct using of ASP.NET Cache</title>
      <description>&lt;p&gt;Often in ASP.NET application we see a code which looks like this one:&lt;/p&gt;

&lt;div style="font-family: Courier New; font-size: 10pt; color: black; background: white;"&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;if&lt;/span&gt; (Cache[&lt;span style="color: #a31515;"&gt;"SomeData"&lt;/span&gt;] != &lt;span style="color: blue;"&gt;null&lt;/span&gt;)&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;string&lt;/span&gt; name = ((&lt;span style="color: #2b91af;"&gt;SomeClass&lt;/span&gt;)Cache[&lt;span style="color: #a31515;"&gt;"SomeData"&lt;/span&gt;]).Name;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: green;"&gt;//.....&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;This code is not safe enough and the second statement can generate a NullReferenceException sometimes. There is no guaranttee that a cached object will stay in the cache between two calls. After the first call it can be deleted either by garbage collector or by another thread to refresh cached data.&lt;/p&gt;

&lt;p&gt;So to overcome this problem rewrite the code using &lt;a href="http://msdn2.microsoft.com/en-us/library/cscsdfbt(VS.80).aspx"&gt;as operator&lt;/a&gt;:&lt;/p&gt;

&lt;div style="font-family: Courier New; font-size: 10pt; color: black; background: white;"&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #2b91af;"&gt;SomeClass&lt;/span&gt; someClass = Cache[&lt;span style="color: #a31515;"&gt;"SomeData"&lt;/span&gt;] &lt;span style="color: blue;"&gt;as&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;SomeClass&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;if&lt;/span&gt; (someClass != &lt;span style="color: blue;"&gt;null&lt;/span&gt;)&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;string&lt;/span&gt; name = someClass.Name;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: green;"&gt;//.....&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;/div&gt;

&lt;p style="margin-top:30px; font-style:italic"&gt;via &lt;a href="http://kpumuk.info/"&gt;Dmytro Shteflyuk&lt;/a&gt;&lt;p&gt;&lt;br /&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=correct-using-of-aspnet-cache"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=correct-using-of-aspnet-cache" border="0"/&gt;&lt;/a&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=jguM0xQSyXs:-S1wR3OEa4o:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=jguM0xQSyXs:-S1wR3OEa4o:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=jguM0xQSyXs:-S1wR3OEa4o:XQ266DUsA9M"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=XQ266DUsA9M" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=jguM0xQSyXs:-S1wR3OEa4o:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=jguM0xQSyXs:-S1wR3OEa4o:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=jguM0xQSyXs:-S1wR3OEa4o:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=jguM0xQSyXs:-S1wR3OEa4o:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=jguM0xQSyXs:-S1wR3OEa4o:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=jguM0xQSyXs:-S1wR3OEa4o:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=jguM0xQSyXs:-S1wR3OEa4o:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotNetTipOfTheDay/~4/jguM0xQSyXs" height="1" width="1"/&gt;</description>
      <guid isPermaLink="false">http://dotnettipoftheday.org/tips/correct-using-of-aspnet-cache.aspx</guid>
      <pubDate>Wed, 30 Jan 2008 16:20:00 GMT</pubDate>
      <wfw:commentRss>http://dotnettipoftheday.org/tips/CommentsRss.aspx?tipid=correct-using-of-aspnet-cache</wfw:commentRss>
    <link>http://feedproxy.google.com/~r/dotNetTipOfTheDay/~3/jguM0xQSyXs/correct-using-of-aspnet-cache.aspx</link><feedburner:origLink>http://dotnettipoftheday.org/tips/correct-using-of-aspnet-cache.aspx</feedburner:origLink></item>
    <item>
      <title>Treat .NET Threads as a shared resource</title>
      <description>&lt;p&gt;Do not create .NET threads on a per-request basis because this can severely impact scalability. Creating new threads is also a fairly expensive operation that should be minimized. Treat threads as a shared resource and use the optimized &lt;a href="http://msdn2.microsoft.com/en-us/library/0ka9477y(VS.80).aspx"&gt;.NET thread pool&lt;/a&gt;.&lt;/p&gt;&lt;br /&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=thread-pool"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=thread-pool" border="0"/&gt;&lt;/a&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=WPcDu7t3twQ:R_yE_LkCHpc:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=WPcDu7t3twQ:R_yE_LkCHpc:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=WPcDu7t3twQ:R_yE_LkCHpc:XQ266DUsA9M"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=XQ266DUsA9M" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=WPcDu7t3twQ:R_yE_LkCHpc:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=WPcDu7t3twQ:R_yE_LkCHpc:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=WPcDu7t3twQ:R_yE_LkCHpc:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=WPcDu7t3twQ:R_yE_LkCHpc:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=WPcDu7t3twQ:R_yE_LkCHpc:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=WPcDu7t3twQ:R_yE_LkCHpc:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=WPcDu7t3twQ:R_yE_LkCHpc:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotNetTipOfTheDay/~4/WPcDu7t3twQ" height="1" width="1"/&gt;</description>
      <guid isPermaLink="false">http://dotnettipoftheday.org/tips/thread-pool.aspx</guid>
      <pubDate>Tue, 22 Jan 2008 01:21:00 GMT</pubDate>
      <wfw:commentRss>http://dotnettipoftheday.org/tips/CommentsRss.aspx?tipid=thread-pool</wfw:commentRss>
    <link>http://feedproxy.google.com/~r/dotNetTipOfTheDay/~3/WPcDu7t3twQ/thread-pool.aspx</link><feedburner:origLink>http://dotnettipoftheday.org/tips/thread-pool.aspx</feedburner:origLink></item>
    <item>
      <title>How to create fully qualified URLs</title>
      <description>&lt;p&gt;With ASP.NET it's quite easy to get absolute path to a page by calling the VirtualPathUtility.ToAbsolute method. Getting absolute URL is not that obvious but still quite easy. Just combine request url with absolute path to your ASP.NET page:&lt;/p&gt;

&lt;div style="font-family: Courier New; font-size: 10pt; color: black; background: white;"&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;string&lt;/span&gt; absolutePath = &lt;span style="color: #2b91af;"&gt;VirtualPathUtility&lt;/span&gt;.ToAbsolute(&lt;span style="color: #a31515;"&gt;"http://dotnettipoftheday.org/test/MyWebForm.aspx"&lt;/span&gt;);&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;Uri&lt;/span&gt; newUri = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;Uri&lt;/span&gt;(Request.Url, absolutePath);&lt;/p&gt;
&lt;/div&gt;
&lt;br /&gt;&lt;br /&gt;
&lt;br /&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=fully-qualified-urls"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=fully-qualified-urls" border="0"/&gt;&lt;/a&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=VIDtSHOCYoc:ylawml_5BGY:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=VIDtSHOCYoc:ylawml_5BGY:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=VIDtSHOCYoc:ylawml_5BGY:XQ266DUsA9M"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=XQ266DUsA9M" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=VIDtSHOCYoc:ylawml_5BGY:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=VIDtSHOCYoc:ylawml_5BGY:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=VIDtSHOCYoc:ylawml_5BGY:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=VIDtSHOCYoc:ylawml_5BGY:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=VIDtSHOCYoc:ylawml_5BGY:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=VIDtSHOCYoc:ylawml_5BGY:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=VIDtSHOCYoc:ylawml_5BGY:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotNetTipOfTheDay/~4/VIDtSHOCYoc" height="1" width="1"/&gt;</description>
      <guid isPermaLink="false">http://dotnettipoftheday.org/tips/fully-qualified-urls.aspx</guid>
      <pubDate>Fri, 18 Jan 2008 13:47:00 GMT</pubDate>
      <wfw:commentRss>http://dotnettipoftheday.org/tips/CommentsRss.aspx?tipid=fully-qualified-urls</wfw:commentRss>
    <link>http://feedproxy.google.com/~r/dotNetTipOfTheDay/~3/VIDtSHOCYoc/fully-qualified-urls.aspx</link><feedburner:origLink>http://dotnettipoftheday.org/tips/fully-qualified-urls.aspx</feedburner:origLink></item>
    <item>
      <title>COALESCE function instead of long CASE WHEN ... ELSE (T-SQL)</title>
      <description>&lt;p&gt;Instead of using long "SELECT ... &lt;a href="http://msdn2.microsoft.com/en-us/library/ms181765.aspx"&gt;CASE WHEN ... ELSE&lt;/a&gt; ..." construction, you can use the &lt;a href="http://msdn2.microsoft.com/en-us/library/ms190349.aspx"&gt;COALESCE&lt;/a&gt; function when you need to find a value that is not NULL. Lets review the following T-SQL expression, in which we need to select an available "source":&lt;/p&gt;

&lt;div style="font-family: Courier New; font-size: 10pt; color: black; background: white;"&gt;
	&lt;p style="margin: 0px;"&gt;&lt;span style="color:blue;"&gt;SELECT&lt;/span&gt; TheSource &lt;span style="color:gray"&gt;=&lt;/span&gt;&lt;/p&gt;
	&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:blue;"&gt;CASE&lt;/span&gt;&lt;/p&gt;
	&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:blue;"&gt;WHEN&lt;/span&gt; localSource &lt;span style="color:gray"&gt;IS NOT NULL&lt;/span&gt; &lt;span style="color:blue"&gt;THEN&lt;/span&gt; localSource&lt;/p&gt;
	&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:blue;"&gt;WHEN&lt;/span&gt; intranetSource &lt;span style="color:gray"&gt;IS NOT NULL&lt;/span&gt; &lt;span style="color:blue"&gt;THEN&lt;/span&gt; intranetSource&lt;/p&gt;
	&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:blue;"&gt;WHEN&lt;/span&gt; internetSource &lt;span style="color:gray"&gt;IS NOT NULL&lt;/span&gt; &lt;span style="color:blue"&gt;THEN&lt;/span&gt; internetSource&lt;/p&gt;
	&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:blue;"&gt;ELSE&lt;/span&gt; &lt;span style="color:red"&gt;''&lt;/span&gt;&lt;/p&gt;
	&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:blue"&gt;END&lt;/span&gt;&lt;/p&gt;
	&lt;p style="margin: 0px;"&gt;&lt;span style="color:blue"&gt;FROM&lt;/span&gt; ...&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Now lets rewrite the code above using COALESCE function:&lt;/p&gt;
&lt;div style="font-family: Courier New; font-size: 10pt; color: black; background: white;"&gt;
	&lt;p style="margin: 0px;"&gt;&lt;span style="color:blue;"&gt;SELECT&lt;/span&gt; TheSource &lt;span style="color:gray"&gt;=&lt;/span&gt;&lt;/p&gt;
	&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:fuchsia"&gt;COALESCE&lt;/span&gt;&lt;span style="color:gray"&gt;(&lt;/span&gt;localSource&lt;span style="color:gray"&gt;,&lt;/span&gt; intranetSource&lt;span style="color:gray"&gt;,&lt;/span&gt; internetSource&lt;span style="color:gray"&gt;,&lt;/span&gt; &lt;span style="color:red"&gt;''&lt;/span&gt;&lt;span style="color:gray"&gt;)&lt;/span&gt;&lt;/p&gt;
	&lt;p style="margin: 0px;"&gt;&lt;span style="color:blue;"&gt;FROM&lt;/span&gt; ...&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;The tip applies to MS SQL Server 2000/2005.&lt;/p&gt;&lt;br /&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=sql-coalesce"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=sql-coalesce" border="0"/&gt;&lt;/a&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=Ca1yzJ7hO-w:9gBgGFwq2qo:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=Ca1yzJ7hO-w:9gBgGFwq2qo:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=Ca1yzJ7hO-w:9gBgGFwq2qo:XQ266DUsA9M"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=XQ266DUsA9M" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=Ca1yzJ7hO-w:9gBgGFwq2qo:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=Ca1yzJ7hO-w:9gBgGFwq2qo:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=Ca1yzJ7hO-w:9gBgGFwq2qo:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=Ca1yzJ7hO-w:9gBgGFwq2qo:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=Ca1yzJ7hO-w:9gBgGFwq2qo:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=Ca1yzJ7hO-w:9gBgGFwq2qo:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=Ca1yzJ7hO-w:9gBgGFwq2qo:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotNetTipOfTheDay/~4/Ca1yzJ7hO-w" height="1" width="1"/&gt;</description>
      <guid isPermaLink="false">http://dotnettipoftheday.org/tips/sql-coalesce.aspx</guid>
      <pubDate>Tue, 15 Jan 2008 22:00:00 GMT</pubDate>
      <wfw:commentRss>http://dotnettipoftheday.org/tips/CommentsRss.aspx?tipid=sql-coalesce</wfw:commentRss>
    <link>http://feedproxy.google.com/~r/dotNetTipOfTheDay/~3/Ca1yzJ7hO-w/sql-coalesce.aspx</link><feedburner:origLink>http://dotnettipoftheday.org/tips/sql-coalesce.aspx</feedburner:origLink></item>
    <item>
      <title>Cut a line into memory</title>
      <description>&lt;p&gt;While in Visual Studio.NET source code editor, press &lt;code style="color:Teal"&gt;Ctrl+L&lt;/code&gt; to cut a line of code into memory. This is an easy way to move lines around your pages, or delete a set of lines quickly. Simple, yet useful!&lt;/p&gt;

&lt;p style="font-style:italic;margin-top:20px;"&gt;submitted by Grant Merwitz, &lt;a href="http://www.thexboxlounge.co.za"&gt;The X-Box Lounge&lt;/a&gt;&lt;/p&gt;&lt;br /&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=cut-line-into-memory"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=cut-line-into-memory" border="0"/&gt;&lt;/a&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=DbiiDB_0Rz8:aV0R6ciP0Js:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=DbiiDB_0Rz8:aV0R6ciP0Js:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=DbiiDB_0Rz8:aV0R6ciP0Js:XQ266DUsA9M"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=XQ266DUsA9M" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=DbiiDB_0Rz8:aV0R6ciP0Js:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=DbiiDB_0Rz8:aV0R6ciP0Js:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=DbiiDB_0Rz8:aV0R6ciP0Js:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=DbiiDB_0Rz8:aV0R6ciP0Js:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=DbiiDB_0Rz8:aV0R6ciP0Js:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=DbiiDB_0Rz8:aV0R6ciP0Js:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=DbiiDB_0Rz8:aV0R6ciP0Js:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotNetTipOfTheDay/~4/DbiiDB_0Rz8" height="1" width="1"/&gt;</description>
      <guid isPermaLink="false">http://dotnettipoftheday.org/tips/cut-line-into-memory.aspx</guid>
      <pubDate>Sun, 13 Jan 2008 12:13:00 GMT</pubDate>
      <wfw:commentRss>http://dotnettipoftheday.org/tips/CommentsRss.aspx?tipid=cut-line-into-memory</wfw:commentRss>
    <link>http://feedproxy.google.com/~r/dotNetTipOfTheDay/~3/DbiiDB_0Rz8/cut-line-into-memory.aspx</link><feedburner:origLink>http://dotnettipoftheday.org/tips/cut-line-into-memory.aspx</feedburner:origLink></item>
    <item>
      <title>How to check email works without using SMTP</title>
      <description>&lt;p&gt;Testing code that sends email has always been a pain. You had to set up a SMTP service just to test that your .NET application sends the e-mail correctly.&lt;/p&gt;

&lt;p&gt;However, there is a way to send e-mails with no SMTP server set up. Just configure your .NET application to drop e-mails into a specified folder instead of sending them via SMTP server:&lt;/p&gt;

&lt;div style="font-family: Courier New; font-size: 10pt; color: black; background: white;"&gt;
	&lt;p style="margin: 0px;"&gt;&lt;span style="color:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;system.net&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
	&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;mailSettings&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
	&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;smtp&lt;/span&gt; &lt;span style="color:Red"&gt;deliveryMethod&lt;/span&gt;&lt;span style="color:Blue"&gt;="SpecifiedPickupDirectory"&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
	&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;specifiedPickupDirectory&lt;/span&gt; &lt;span style="color:Red"&gt;pickupDirectoryLocation&lt;/span&gt;&lt;span style="color:Blue"&gt;="c:\Test\"&lt;/span&gt; &lt;span style="color:blue;"&gt;/&amp;gt;&lt;/span&gt;&lt;/p&gt;
	&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;smtp&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
	&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;mailSettings&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
	&lt;p style="margin: 0px;"&gt;&lt;span style="color:blue;"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;system.net&lt;/span&gt;&lt;span style="color:blue;"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;This will instruct SmtpClient class to generate mail message, save it as .eml file and drop it into &lt;strong&gt;c:\Test\&lt;/strong&gt; folder.&lt;/p&gt;

&lt;!-- http://www.andornot.com/about/developerblog/2007/07/testing-websites-that-use-smtp-email-on.aspx

http://www.dotnetnuke.com/Default.aspx?tabid=825&amp;EntryID=1542

http://edinkapic.blogspot.com/2007/11/how-to-test-net-application-that-uses.html

SpecifiedPickupDirectory --&gt;&lt;br /&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=smtp-delivery-method-SpecifiedPickupDirectory"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=smtp-delivery-method-SpecifiedPickupDirectory" border="0"/&gt;&lt;/a&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=xhVseXWuTdA:JkdU3zTd9IU:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=xhVseXWuTdA:JkdU3zTd9IU:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=xhVseXWuTdA:JkdU3zTd9IU:XQ266DUsA9M"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=XQ266DUsA9M" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=xhVseXWuTdA:JkdU3zTd9IU:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=xhVseXWuTdA:JkdU3zTd9IU:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=xhVseXWuTdA:JkdU3zTd9IU:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=xhVseXWuTdA:JkdU3zTd9IU:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=xhVseXWuTdA:JkdU3zTd9IU:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=xhVseXWuTdA:JkdU3zTd9IU:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=xhVseXWuTdA:JkdU3zTd9IU:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotNetTipOfTheDay/~4/xhVseXWuTdA" height="1" width="1"/&gt;</description>
      <guid isPermaLink="false">http://dotnettipoftheday.org/tips/smtp-delivery-method-SpecifiedPickupDirectory.aspx</guid>
      <pubDate>Tue, 08 Jan 2008 22:15:00 GMT</pubDate>
      <wfw:commentRss>http://dotnettipoftheday.org/tips/CommentsRss.aspx?tipid=smtp-delivery-method-SpecifiedPickupDirectory</wfw:commentRss>
    <link>http://feedproxy.google.com/~r/dotNetTipOfTheDay/~3/xhVseXWuTdA/smtp-delivery-method-SpecifiedPickupDirectory.aspx</link><feedburner:origLink>http://dotnettipoftheday.org/tips/smtp-delivery-method-SpecifiedPickupDirectory.aspx</feedburner:origLink></item>
    <item>
      <title>A simple method to validate an integer, double, date, and currency values entered into a textbox on ASP.NET page</title>
      <description>&lt;p&gt;Normally the &lt;a href="http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.comparevalidator.aspx"&gt;CompareValidator&lt;/a&gt; is used to check one value against another on ASP.NET page. However it also can be used to ensure user has entered data in a correct format.&lt;/p&gt;

&lt;p&gt;Here's how it works:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Set the &lt;a href="http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.basevalidator.controltovalidate.aspx"&gt;ControlToValidate&lt;/a&gt; property to the ID of the TextBox.&lt;/li&gt;
&lt;li&gt;Set the &lt;a href="http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.comparevalidator.operator.aspx"&gt;Operator&lt;/a&gt; property to &lt;strong&gt;DataTypeCheck&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Assign a &lt;a href="http://msdn2.microsoft.com/en-us/library/85y3x2a2.aspx"&gt;ValidationDataType&lt;/a&gt; enumeration member to the &lt;a href="http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.basecomparevalidator.type.aspx"&gt;Type&lt;/a&gt; property, which includes &lt;strong&gt;String&lt;/strong&gt;, &lt;strong&gt;Integer&lt;/strong&gt;, &lt;strong&gt;Double&lt;/strong&gt;, &lt;strong&gt;Date&lt;/strong&gt;, and &lt;strong&gt;Currency&lt;/strong&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;p style="margin-top:30px"&gt;Note: this method is culturally sensitive. This means that if you change your browsers settings to en-UK, a date of 1-28-01 correctly fires the validator, while 28-1-01 is allowed through. This is because the date format is day-month-year in that region.&lt;/p&gt;&lt;br /&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=validate-format-of-integer-double-date-currency"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=validate-format-of-integer-double-date-currency" border="0"/&gt;&lt;/a&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=oQI589FQv04:f_OZddkra3Y:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=oQI589FQv04:f_OZddkra3Y:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=oQI589FQv04:f_OZddkra3Y:XQ266DUsA9M"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=XQ266DUsA9M" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=oQI589FQv04:f_OZddkra3Y:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=oQI589FQv04:f_OZddkra3Y:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=oQI589FQv04:f_OZddkra3Y:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=oQI589FQv04:f_OZddkra3Y:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=oQI589FQv04:f_OZddkra3Y:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=oQI589FQv04:f_OZddkra3Y:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=oQI589FQv04:f_OZddkra3Y:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotNetTipOfTheDay/~4/oQI589FQv04" height="1" width="1"/&gt;</description>
      <guid isPermaLink="false">http://dotnettipoftheday.org/tips/validate-format-of-integer-double-date-currency.aspx</guid>
      <pubDate>Sat, 05 Jan 2008 23:59:00 GMT</pubDate>
      <wfw:commentRss>http://dotnettipoftheday.org/tips/CommentsRss.aspx?tipid=validate-format-of-integer-double-date-currency</wfw:commentRss>
    <link>http://feedproxy.google.com/~r/dotNetTipOfTheDay/~3/oQI589FQv04/validate-format-of-integer-double-date-currency.aspx</link><feedburner:origLink>http://dotnettipoftheday.org/tips/validate-format-of-integer-double-date-currency.aspx</feedburner:origLink></item>
    <item>
      <title>What is the difference between UriBuilder.ToString and UriBuilder.Uri.ToString</title>
      <description>&lt;ul&gt;
&lt;li&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/system.uribuilder.tostring.aspx"&gt;UriBuilder.ToString&lt;/a&gt; - the resulting string always contains &lt;a href="http://msdn2.microsoft.com/en-us/library/system.uribuilder.port.aspx"&gt;Port&lt;/a&gt;, even if it is the default port for the &lt;a href="http://msdn2.microsoft.com/en-us/library/system.uribuilder.scheme.aspx"&gt;Scheme&lt;/a&gt;. For example - http://localhost&lt;strong&gt;:80&lt;/strong&gt;/tips.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/system.uri.tostring.aspx"&gt;UriBuilder.Uri.ToString&lt;/a&gt; - the resulting string only contains the port if it is not the default port for the scheme. For example - http://localhost/tips.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Therefore, in most of the cases &lt;strong&gt;UriBuilder.Uri.ToString&lt;/strong&gt; should be used to omit redundant port specification.&lt;/p&gt;&lt;br /&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=UriBuilder.ToString-vs-UriBuilder.Uri.ToString"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=UriBuilder.ToString-vs-UriBuilder.Uri.ToString" border="0"/&gt;&lt;/a&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=uIOd2EKD1vU:qulH9sRhMFA:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=uIOd2EKD1vU:qulH9sRhMFA:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=uIOd2EKD1vU:qulH9sRhMFA:XQ266DUsA9M"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=XQ266DUsA9M" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=uIOd2EKD1vU:qulH9sRhMFA:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=uIOd2EKD1vU:qulH9sRhMFA:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=uIOd2EKD1vU:qulH9sRhMFA:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=uIOd2EKD1vU:qulH9sRhMFA:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=uIOd2EKD1vU:qulH9sRhMFA:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=uIOd2EKD1vU:qulH9sRhMFA:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=uIOd2EKD1vU:qulH9sRhMFA:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotNetTipOfTheDay/~4/uIOd2EKD1vU" height="1" width="1"/&gt;</description>
      <guid isPermaLink="false">http://dotnettipoftheday.org/tips/UriBuilder.ToString-vs-UriBuilder.Uri.ToString.aspx</guid>
      <pubDate>Wed, 26 Dec 2007 23:30:00 GMT</pubDate>
      <wfw:commentRss>http://dotnettipoftheday.org/tips/CommentsRss.aspx?tipid=UriBuilder.ToString-vs-UriBuilder.Uri.ToString</wfw:commentRss>
    <link>http://feedproxy.google.com/~r/dotNetTipOfTheDay/~3/uIOd2EKD1vU/UriBuilder.ToString-vs-UriBuilder.Uri.ToString.aspx</link><feedburner:origLink>http://dotnettipoftheday.org/tips/UriBuilder.ToString-vs-UriBuilder.Uri.ToString.aspx</feedburner:origLink></item>
    <item>
      <title>Visual Studio Bookmarks</title>
      <description>&lt;p&gt;Bookmarks can be used to mark places in the code, like the code that you might want to jump back and forward. Bookmarks can be related to task list shortcuts, kind of the same functinality.&lt;/p&gt;

&lt;p&gt;The bookmarks can be setup very easy, by pressing &lt;code style="color:Teal"&gt;Ctrl+K&lt;/code&gt;, &lt;code style="color:Teal"&gt;Ctrl+K&lt;/code&gt; to leave bookmark.&lt;/p&gt;

&lt;img src="http://dotnettipoftheday.org/resources/visual-studio-bookmarks.png" alt="Bookmarked line marked with an icon." /&gt;

&lt;p&gt;For navigation, you can press &lt;code style="color:Teal"&gt;Ctrl+K&lt;/code&gt;, &lt;code style="color:Teal"&gt;Ctrl+N&lt;/code&gt; to move to the next bookmark, or &lt;code style="color:Teal"&gt;Ctrl+K&lt;/code&gt;, &lt;code style="color:Teal"&gt;CTRL+P&lt;/code&gt; for the previous bookmark. It's easy, just try it now.&lt;/p&gt;
&lt;br /&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=bookmarks-in-visual-studio"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=bookmarks-in-visual-studio" border="0"/&gt;&lt;/a&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=xw9xjk-Bquo:B1ZWaj5UijQ:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=xw9xjk-Bquo:B1ZWaj5UijQ:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=xw9xjk-Bquo:B1ZWaj5UijQ:XQ266DUsA9M"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=XQ266DUsA9M" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=xw9xjk-Bquo:B1ZWaj5UijQ:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=xw9xjk-Bquo:B1ZWaj5UijQ:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=xw9xjk-Bquo:B1ZWaj5UijQ:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=xw9xjk-Bquo:B1ZWaj5UijQ:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=xw9xjk-Bquo:B1ZWaj5UijQ:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=xw9xjk-Bquo:B1ZWaj5UijQ:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=xw9xjk-Bquo:B1ZWaj5UijQ:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotNetTipOfTheDay/~4/xw9xjk-Bquo" height="1" width="1"/&gt;</description>
      <guid isPermaLink="false">http://dotnettipoftheday.org/tips/bookmarks-in-visual-studio.aspx</guid>
      <pubDate>Fri, 21 Dec 2007 17:01:00 GMT</pubDate>
      <wfw:commentRss>http://dotnettipoftheday.org/tips/CommentsRss.aspx?tipid=bookmarks-in-visual-studio</wfw:commentRss>
    <link>http://feedproxy.google.com/~r/dotNetTipOfTheDay/~3/xw9xjk-Bquo/bookmarks-in-visual-studio.aspx</link><feedburner:origLink>http://dotnettipoftheday.org/tips/bookmarks-in-visual-studio.aspx</feedburner:origLink></item>
    <item>
      <title>Generating compiler warnings for calls to an obsolete methods</title>
      <description>&lt;p&gt;Throughout the product development cycle, occasionally certain methods become obsolete. If you can't modify those methods, will need to write another implementation of the method using a slightly different name or signature. To maintain compatibility, you do not want to remove the old method and break your code. This is where the .NET &lt;a href="http://msdn2.microsoft.com/en-us/library/system.obsoleteattribute.aspx"&gt;Obsolete&lt;/a&gt; attribute comes in handy:&lt;/p&gt;

&lt;div style="font-family: Courier New; font-size: 10pt; color: black; background: white;"&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; [&lt;span style="color: #2b91af;"&gt;Obsolete&lt;/span&gt;(&lt;span style="color: #a31515;"&gt;"Use the new LogRequestEx instead."&lt;/span&gt;)]&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;static&lt;/span&gt; &lt;span style="color: blue;"&gt;void&lt;/span&gt; LogRequest(&lt;span style="color: blue;"&gt;string&lt;/span&gt; feedUrl, &lt;span style="color: blue;"&gt;string&lt;/span&gt; referer)&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Setting the Obsolete attribute as above makes a warning message appear in the Visual Studio's Error List stating that the particular call to a method is obsolete. The warning message also includes your personalized message that you pass as the attribute's argument (such as, "Use the new LogRequestEx instead").&lt;/p&gt;&lt;br /&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=ObsoleteAttribute"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=ObsoleteAttribute" border="0"/&gt;&lt;/a&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=Ohlj-FVFJq4:yVVllRKsre0:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=Ohlj-FVFJq4:yVVllRKsre0:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=Ohlj-FVFJq4:yVVllRKsre0:XQ266DUsA9M"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=XQ266DUsA9M" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=Ohlj-FVFJq4:yVVllRKsre0:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=Ohlj-FVFJq4:yVVllRKsre0:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=Ohlj-FVFJq4:yVVllRKsre0:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=Ohlj-FVFJq4:yVVllRKsre0:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=Ohlj-FVFJq4:yVVllRKsre0:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=Ohlj-FVFJq4:yVVllRKsre0:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=Ohlj-FVFJq4:yVVllRKsre0:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotNetTipOfTheDay/~4/Ohlj-FVFJq4" height="1" width="1"/&gt;</description>
      <guid isPermaLink="false">http://dotnettipoftheday.org/tips/ObsoleteAttribute.aspx</guid>
      <pubDate>Sat, 15 Dec 2007 01:17:00 GMT</pubDate>
      <wfw:commentRss>http://dotnettipoftheday.org/tips/CommentsRss.aspx?tipid=ObsoleteAttribute</wfw:commentRss>
    <link>http://feedproxy.google.com/~r/dotNetTipOfTheDay/~3/Ohlj-FVFJq4/ObsoleteAttribute.aspx</link><feedburner:origLink>http://dotnettipoftheday.org/tips/ObsoleteAttribute.aspx</feedburner:origLink></item>
    <item>
      <title>Big solutions can be organized using Solution Folders</title>
      <description>&lt;p&gt;Here is an example of a big Visual Studio.NET solution that contains numerous projects:&lt;/p&gt;
&lt;div style="text-align:center; width:100%;"&gt;&lt;img src="http://dotnettipoftheday.org/resources/visual-studio-solution-1.png" alt="Unorganized Visual Studio.NET solution" /&gt;&lt;/div&gt;

&lt;p&gt;Such a big Visual Studio.NET solutions can be organized by grouping related projects into folders. Just right-click on the solution node and choose &lt;strong&gt;Add | New Solution Folder&lt;/strong&gt; to add a Solution Folder. Then just Drag'n'Drop projects into this folder.&lt;/p&gt;

&lt;div style="text-align:center; width:100%;"&gt;&lt;img src="http://dotnettipoftheday.org/resources/visual-studio-solution-2.png" alt="Organized Visual Studio.NET solution" /&gt;&lt;/div&gt;

&lt;p&gt;This also will allow you to do some operations on a group of projects. For example, unload all projects in a Solution Folder, collapse or hide entire Solution Folder so that you can work easily in Solution Explorer in Visual Studio.NET.&lt;/p&gt;&lt;br /&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=visual-studio-solution-folders"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=visual-studio-solution-folders" border="0"/&gt;&lt;/a&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=rXGm9bS5N38:t8JadEGge90:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=rXGm9bS5N38:t8JadEGge90:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=rXGm9bS5N38:t8JadEGge90:XQ266DUsA9M"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=XQ266DUsA9M" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=rXGm9bS5N38:t8JadEGge90:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=rXGm9bS5N38:t8JadEGge90:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=rXGm9bS5N38:t8JadEGge90:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=rXGm9bS5N38:t8JadEGge90:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=rXGm9bS5N38:t8JadEGge90:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=rXGm9bS5N38:t8JadEGge90:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=rXGm9bS5N38:t8JadEGge90:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotNetTipOfTheDay/~4/rXGm9bS5N38" height="1" width="1"/&gt;</description>
      <guid isPermaLink="false">http://dotnettipoftheday.org/tips/visual-studio-solution-folders.aspx</guid>
      <pubDate>Fri, 07 Dec 2007 19:55:00 GMT</pubDate>
      <wfw:commentRss>http://dotnettipoftheday.org/tips/CommentsRss.aspx?tipid=visual-studio-solution-folders</wfw:commentRss>
    <link>http://feedproxy.google.com/~r/dotNetTipOfTheDay/~3/rXGm9bS5N38/visual-studio-solution-folders.aspx</link><feedburner:origLink>http://dotnettipoftheday.org/tips/visual-studio-solution-folders.aspx</feedburner:origLink></item>
    <item>
      <title>How to change the default view for Web pages and WinForms in Visual Studio</title>
      <description>&lt;p&gt;By default Visual Studio.NET initially displays Web pages and WinForms in a Design view. But if you prefer Source view, you can set it to be the default view.&lt;/p&gt;
&lt;p&gt;For Web pages:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Go to &lt;strong&gt;Tools | Options... | HTML Designer&lt;/strong&gt; and select &lt;strong&gt;Source View&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;OK&lt;/strong&gt; button.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;For WinForms:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Right-click on a WinForm in the Solution Explorer and then click &lt;strong&gt;Open With...&lt;/strong&gt;. &lt;strong&gt;Open With&lt;/strong&gt; dialog opens.&lt;/li&gt;
&lt;li&gt;Choose &lt;strong&gt;CSharp Editor&lt;/strong&gt; in the list and then click &lt;strong&gt;Set as Default&lt;/strong&gt; button.&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;OK&lt;/strong&gt; button.&lt;/li&gt;
&lt;/ol&gt;&lt;br /&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=visual-studio-source-view"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=visual-studio-source-view" border="0"/&gt;&lt;/a&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=1nVOv7v9hO4:pw9fC_tPDsA:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=1nVOv7v9hO4:pw9fC_tPDsA:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=1nVOv7v9hO4:pw9fC_tPDsA:XQ266DUsA9M"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=XQ266DUsA9M" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=1nVOv7v9hO4:pw9fC_tPDsA:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=1nVOv7v9hO4:pw9fC_tPDsA:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=1nVOv7v9hO4:pw9fC_tPDsA:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=1nVOv7v9hO4:pw9fC_tPDsA:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=1nVOv7v9hO4:pw9fC_tPDsA:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=1nVOv7v9hO4:pw9fC_tPDsA:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=1nVOv7v9hO4:pw9fC_tPDsA:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotNetTipOfTheDay/~4/1nVOv7v9hO4" height="1" width="1"/&gt;</description>
      <guid isPermaLink="false">http://dotnettipoftheday.org/tips/visual-studio-source-view.aspx</guid>
      <pubDate>Wed, 05 Dec 2007 17:20:00 GMT</pubDate>
      <wfw:commentRss>http://dotnettipoftheday.org/tips/CommentsRss.aspx?tipid=visual-studio-source-view</wfw:commentRss>
    <link>http://feedproxy.google.com/~r/dotNetTipOfTheDay/~3/1nVOv7v9hO4/visual-studio-source-view.aspx</link><feedburner:origLink>http://dotnettipoftheday.org/tips/visual-studio-source-view.aspx</feedburner:origLink></item>
    <item>
      <title>Use DebuggerBrowsable attribute to clean up class view in a debugger</title>
      <description>&lt;p&gt;The &lt;a href="http://msdn2.microsoft.com/en-us/library/system.diagnostics.debuggerbrowsableattribute.aspx"&gt;DebuggerBrowsable&lt;/a&gt; attribute determines if and how a field or property is displayed in the debugger variable windows. Let's review the following code example:&lt;/p&gt;

&lt;div style="font-family: Courier New; font-size: 10pt; color: black; background: white;"&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;class&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;VehicleSeries&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;private&lt;/span&gt; &lt;span style="color: blue;"&gt;string&lt;/span&gt; _name;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;string&lt;/span&gt; Name&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;get&lt;/span&gt; { &lt;span style="color: blue;"&gt;return&lt;/span&gt; _name; }&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;set&lt;/span&gt; { _name = &lt;span style="color: blue;"&gt;value&lt;/span&gt;; }&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;private&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="color: blue;"&gt;string&lt;/span&gt;&amp;gt; _vehicles = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="color: blue;"&gt;string&lt;/span&gt;&amp;gt;();&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="color: blue;"&gt;string&lt;/span&gt;&amp;gt; Vehicles&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;get&lt;/span&gt; { &lt;span style="color: blue;"&gt;return&lt;/span&gt; _vehicles; }&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;set&lt;/span&gt; { _vehicles = &lt;span style="color: blue;"&gt;value&lt;/span&gt;; }&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;The resulting display within the debugger is shown below:&lt;/p&gt;

&lt;div style="font-family: Courier New; font-size: 10pt; color: black; background: white;"&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;img src="http://dotnettipoftheday.org/resources/DebuggerBrowsableAttribute1.png" alt="DataTip 1" /&gt;
&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Now lets remove duplicate information and show constituent vehicles by adding a few DebuggerBrowsable attributes:&lt;/p&gt;

&lt;div style="font-family: Courier New; font-size: 10pt; color: black; background: white;"&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;class&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;VehicleSeries&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; [&lt;span style="color: #2b91af;"&gt;DebuggerBrowsable&lt;/span&gt;(&lt;span style="color: #2b91af;"&gt;DebuggerBrowsableState&lt;/span&gt;.Never)]&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;private&lt;/span&gt; &lt;span style="color: blue;"&gt;string&lt;/span&gt; _name;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;string&lt;/span&gt; Name&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;get&lt;/span&gt; { &lt;span style="color: blue;"&gt;return&lt;/span&gt; _name; }&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;set&lt;/span&gt; { _name = &lt;span style="color: blue;"&gt;value&lt;/span&gt;; }&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; [&lt;span style="color: #2b91af;"&gt;DebuggerBrowsable&lt;/span&gt;(&lt;span style="color: #2b91af;"&gt;DebuggerBrowsableState&lt;/span&gt;.Never)]&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;private&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="color: blue;"&gt;string&lt;/span&gt;&amp;gt; _vehicles = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="color: blue;"&gt;string&lt;/span&gt;&amp;gt;();&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; [&lt;span style="color: #2b91af;"&gt;DebuggerBrowsable&lt;/span&gt;(&lt;span style="color: #2b91af;"&gt;DebuggerBrowsableState&lt;/span&gt;.RootHidden)]&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="color: blue;"&gt;string&lt;/span&gt;&amp;gt; Vehicles&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;get&lt;/span&gt; { &lt;span style="color: blue;"&gt;return&lt;/span&gt; _vehicles; }&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;set&lt;/span&gt; { _vehicles = &lt;span style="color: blue;"&gt;value&lt;/span&gt;; }&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;/div&gt;


&lt;p&gt;This results in the following view in the debugger:&lt;/p&gt;

&lt;div style="font-family: Courier New; font-size: 10pt; color: black; background: white;"&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;img src="http://dotnettipoftheday.org/resources/DebuggerBrowsableAttribute2.png" alt="DataTip 2" /&gt;
&lt;/p&gt;
&lt;/div&gt;

&lt;p style="margin-top:30px"&gt;P.S. Also take a look at a tip "&lt;a href="http://dotnettipoftheday.org/tips/debuggerdisplay_attribute.aspx"&gt;Use DebuggerDisplay attribute for a better debugger experience&lt;/a&gt;".&lt;/p&gt;&lt;br /&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=DebuggerBrowsableAttribute"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=DebuggerBrowsableAttribute" border="0"/&gt;&lt;/a&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=BMn4sl7uglE:TCAFtCtZPL8:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=BMn4sl7uglE:TCAFtCtZPL8:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=BMn4sl7uglE:TCAFtCtZPL8:XQ266DUsA9M"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=XQ266DUsA9M" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=BMn4sl7uglE:TCAFtCtZPL8:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=BMn4sl7uglE:TCAFtCtZPL8:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=BMn4sl7uglE:TCAFtCtZPL8:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=BMn4sl7uglE:TCAFtCtZPL8:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=BMn4sl7uglE:TCAFtCtZPL8:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=BMn4sl7uglE:TCAFtCtZPL8:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=BMn4sl7uglE:TCAFtCtZPL8:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotNetTipOfTheDay/~4/BMn4sl7uglE" height="1" width="1"/&gt;</description>
      <guid isPermaLink="false">http://dotnettipoftheday.org/tips/DebuggerBrowsableAttribute.aspx</guid>
      <pubDate>Sun, 02 Dec 2007 23:11:00 GMT</pubDate>
      <wfw:commentRss>http://dotnettipoftheday.org/tips/CommentsRss.aspx?tipid=DebuggerBrowsableAttribute</wfw:commentRss>
    <link>http://feedproxy.google.com/~r/dotNetTipOfTheDay/~3/BMn4sl7uglE/DebuggerBrowsableAttribute.aspx</link><feedburner:origLink>http://dotnettipoftheday.org/tips/DebuggerBrowsableAttribute.aspx</feedburner:origLink></item>
    <item>
      <title>What is the difference between URL and URI?</title>
      <description>&lt;p&gt;A URL is the address of some resource on the web, which means that normally you type the address into a browser and you get something back. There are other type of resources than web pages, but that's the easiest conceptually. The browser goes out somewhere on the internet and accesses something.&lt;/p&gt;

&lt;p&gt;A URI is just a unique string that uniquely identifies something, commonly a namespace. Sometimes they look like a URL that you could type into the address bar of your web browser, but it doesn't have to point to any physical resource on the web.&lt;/p&gt;

&lt;p&gt;URI is the more generic term, and a URL is a particular type of URI in that a URL has to uniquely identify some resource on the web.&lt;/p&gt;
&lt;p style="font-style:italic"&gt;&lt;br /&gt;via &lt;a href="http://www.fedia.net/"&gt;Fedia.net&lt;/a&gt;
&lt;/p&gt;&lt;br /&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=url-vs-uri"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=url-vs-uri" border="0"/&gt;&lt;/a&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=11kDrDGc6JY:jVhlnIi7Kd0:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=11kDrDGc6JY:jVhlnIi7Kd0:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=11kDrDGc6JY:jVhlnIi7Kd0:XQ266DUsA9M"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=XQ266DUsA9M" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=11kDrDGc6JY:jVhlnIi7Kd0:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=11kDrDGc6JY:jVhlnIi7Kd0:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=11kDrDGc6JY:jVhlnIi7Kd0:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=11kDrDGc6JY:jVhlnIi7Kd0:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=11kDrDGc6JY:jVhlnIi7Kd0:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=11kDrDGc6JY:jVhlnIi7Kd0:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=11kDrDGc6JY:jVhlnIi7Kd0:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotNetTipOfTheDay/~4/11kDrDGc6JY" height="1" width="1"/&gt;</description>
      <guid isPermaLink="false">http://dotnettipoftheday.org/tips/url-vs-uri.aspx</guid>
      <pubDate>Fri, 23 Nov 2007 21:46:00 GMT</pubDate>
      <wfw:commentRss>http://dotnettipoftheday.org/tips/CommentsRss.aspx?tipid=url-vs-uri</wfw:commentRss>
    <link>http://feedproxy.google.com/~r/dotNetTipOfTheDay/~3/11kDrDGc6JY/url-vs-uri.aspx</link><feedburner:origLink>http://dotnettipoftheday.org/tips/url-vs-uri.aspx</feedburner:origLink></item>
    <item>
      <title>Don't generate unnecessary WinForm members for Label controls</title>
      <description>&lt;p&gt;To get rid of some auto-generated form level fields that point to a control that will never be referenced (for example, labels, panels, etc.), do the following:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;In the Windows Forms Designer, select a control.&lt;/li&gt;
&lt;li&gt;Set &lt;a href="http://msdn2.microsoft.com/en-us/library/ms233630.aspx"&gt;GenerateMember&lt;/a&gt; property for this control to &lt;strong&gt;false&lt;/strong&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;As a result a member of the form will not be generated for this control. It saves you 4 bytes per member and more importantly removes "clutter" from IntelliSense and any diagrams you autogenerate.&lt;/p&gt;&lt;br /&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=GenerateMember"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=GenerateMember" border="0"/&gt;&lt;/a&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=GP3cgy7CB7U:5gpNb_yVRSA:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=GP3cgy7CB7U:5gpNb_yVRSA:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=GP3cgy7CB7U:5gpNb_yVRSA:XQ266DUsA9M"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=XQ266DUsA9M" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=GP3cgy7CB7U:5gpNb_yVRSA:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=GP3cgy7CB7U:5gpNb_yVRSA:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=GP3cgy7CB7U:5gpNb_yVRSA:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=GP3cgy7CB7U:5gpNb_yVRSA:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=GP3cgy7CB7U:5gpNb_yVRSA:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=GP3cgy7CB7U:5gpNb_yVRSA:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=GP3cgy7CB7U:5gpNb_yVRSA:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotNetTipOfTheDay/~4/GP3cgy7CB7U" height="1" width="1"/&gt;</description>
      <guid isPermaLink="false">http://dotnettipoftheday.org/tips/GenerateMember.aspx</guid>
      <pubDate>Wed, 21 Nov 2007 20:54:00 GMT</pubDate>
      <wfw:commentRss>http://dotnettipoftheday.org/tips/CommentsRss.aspx?tipid=GenerateMember</wfw:commentRss>
    <link>http://feedproxy.google.com/~r/dotNetTipOfTheDay/~3/GP3cgy7CB7U/GenerateMember.aspx</link><feedburner:origLink>http://dotnettipoftheday.org/tips/GenerateMember.aspx</feedburner:origLink></item>
    <item>
      <title>Simplify the usability of your generic methods with type parameter inference</title>
      <description>&lt;p&gt;When the parameter signature of a generic method includes a parameter that is of the same type as the type parameter for the method, it's not necessary to specify the type parameter when calling the method. Let's review an example:&lt;/p&gt;

&lt;div style="font-family: Courier New; font-size: 10pt; color: black; background: white;"&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;class&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;Class1&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: green;"&gt;//both method type argument and parameter are of the same type&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;void&lt;/span&gt; SomeGenericMethod&amp;lt;T&amp;gt;(T sameAsTypeParameter)&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;class&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;Test&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;static&lt;/span&gt; &lt;span style="color: blue;"&gt;void&lt;/span&gt; Main()&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #2b91af;"&gt;Class1&lt;/span&gt; obj = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;Class1&lt;/span&gt;();&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: green;"&gt;//It's not necessary to specify method type parameter&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: green;"&gt;//Instead of obj.SomeGenericMethod&amp;lt;int&amp;gt;(100) use&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; obj.SomeGenericMethod(100);&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;As you can see in the example above, the syntax for calling generic method is identical to syntax of calling non-generic method. This ability is called generic type inference. To enable inference, the parameter signature of a generic method must include a parameter that is of the same type as the type parameter for the method.&lt;/p&gt;

&lt;p&gt;Note: the compiler cannot infer the type based on the type of the returned value alone.&lt;/p&gt;&lt;br /&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=generic-method-inference"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=generic-method-inference" border="0"/&gt;&lt;/a&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=mjw9SAVqYUE:NB4P9lYdx9k:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=mjw9SAVqYUE:NB4P9lYdx9k:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=mjw9SAVqYUE:NB4P9lYdx9k:XQ266DUsA9M"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=XQ266DUsA9M" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=mjw9SAVqYUE:NB4P9lYdx9k:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=mjw9SAVqYUE:NB4P9lYdx9k:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=mjw9SAVqYUE:NB4P9lYdx9k:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=mjw9SAVqYUE:NB4P9lYdx9k:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=mjw9SAVqYUE:NB4P9lYdx9k:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=mjw9SAVqYUE:NB4P9lYdx9k:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=mjw9SAVqYUE:NB4P9lYdx9k:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotNetTipOfTheDay/~4/mjw9SAVqYUE" height="1" width="1"/&gt;</description>
      <guid isPermaLink="false">http://dotnettipoftheday.org/tips/generic-method-inference.aspx</guid>
      <pubDate>Tue, 20 Nov 2007 17:54:00 GMT</pubDate>
      <wfw:commentRss>http://dotnettipoftheday.org/tips/CommentsRss.aspx?tipid=generic-method-inference</wfw:commentRss>
    <link>http://feedproxy.google.com/~r/dotNetTipOfTheDay/~3/mjw9SAVqYUE/generic-method-inference.aspx</link><feedburner:origLink>http://dotnettipoftheday.org/tips/generic-method-inference.aspx</feedburner:origLink></item>
    <item>
      <title>Two approaches to update database row if exists, insert if not</title>
      <description>&lt;p&gt;The biggest challenge with update/insert (so called &lt;a href="http://en.wikipedia.org/wiki/Upsert"&gt;upsert&lt;/a&gt;) is to minimize any kind of locks. Unfortunately there is no silver bullet for this &lt;a href="http://msdn2.microsoft.com/en-us/library/bb522522(SQL.100).aspx"&gt;yet&lt;/a&gt;. So let's review two the most commonly used methods:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Update, if @@ROWCOUNT = 0 then insert&lt;/strong&gt;&lt;/p&gt;

&lt;div style="font-family: Courier New; font-size: 10pt; color: black; background: white;"&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue"&gt;UPDATE&lt;/span&gt; Table1 &lt;span style="color:blue"&gt;SET&lt;/span&gt; Column1 = @newValue &lt;span style="color:blue"&gt;WHERE&lt;/span&gt; Id = @id&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue"&gt;IF&lt;/span&gt; &lt;span style="color:fuchsia"&gt;@@ROWCOUNT&lt;/span&gt; = 0&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue"&gt;BEGIN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:blue"&gt;INSERT INTO&lt;/span&gt; Table1 (Id, Column1) &lt;span style="color:blue"&gt;VALUES&lt;/span&gt; (@id, @newValue)&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue"&gt;END&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;This method is good if you know that in most of the cases a row will exist and update will be performed. Otherwise the second method should be used.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. If row exists update, otherwise insert&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;
&lt;div style="font-family: Courier New; font-size: 10pt; color: black; background: white;"&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue"&gt;IF&lt;/span&gt; &lt;span style="color:gray"&gt;EXISTS&lt;/span&gt;(&lt;span style="color:blue"&gt;SELECT&lt;/span&gt; * &lt;span style="color:blue"&gt;FROM&lt;/span&gt; Table1 &lt;span style="color:blue"&gt;WHERE&lt;/span&gt; Id = @id)&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue"&gt;BEGIN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:blue"&gt;UPDATE&lt;/span&gt; Table1 &lt;span style="color:blue"&gt;SET&lt;/span&gt; Column1 = @newValue &lt;span style="color:blue"&gt;WHERE&lt;/span&gt; Id = @id&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue"&gt;END&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue"&gt;ELSE&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue"&gt;BEGIN&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:blue"&gt;INSERT INTO&lt;/span&gt; Table1 (Id, Column1) &lt;span style="color:blue"&gt;VALUES&lt;/span&gt; (@id, @newValue)&lt;/p&gt;
&lt;p style="margin:0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue"&gt;END&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;This one is good if you know that in most of the cases a row will not exist and insert will be performed. For such cases it executes SELECT statement followed by INSERT statement. That results in less expensive lock comparing to UPDATE + INSERT in previous method.&lt;/p&gt;

&lt;p style="margin-top:30px"&gt;P.S. both methods should be used in transaction with isolation level &lt;strong&gt;Serializable&lt;/strong&gt;.&lt;/p&gt;&lt;br /&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=update-insert-row-sql"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=update-insert-row-sql" border="0"/&gt;&lt;/a&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=zAx72O2HfVI:82xYGx5lSOk:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=zAx72O2HfVI:82xYGx5lSOk:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=zAx72O2HfVI:82xYGx5lSOk:XQ266DUsA9M"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=XQ266DUsA9M" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=zAx72O2HfVI:82xYGx5lSOk:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=zAx72O2HfVI:82xYGx5lSOk:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=zAx72O2HfVI:82xYGx5lSOk:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=zAx72O2HfVI:82xYGx5lSOk:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=zAx72O2HfVI:82xYGx5lSOk:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=zAx72O2HfVI:82xYGx5lSOk:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=zAx72O2HfVI:82xYGx5lSOk:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotNetTipOfTheDay/~4/zAx72O2HfVI" height="1" width="1"/&gt;</description>
      <guid isPermaLink="false">http://dotnettipoftheday.org/tips/update-insert-row-sql.aspx</guid>
      <pubDate>Sat, 17 Nov 2007 23:00:00 GMT</pubDate>
      <wfw:commentRss>http://dotnettipoftheday.org/tips/CommentsRss.aspx?tipid=update-insert-row-sql</wfw:commentRss>
    <link>http://feedproxy.google.com/~r/dotNetTipOfTheDay/~3/zAx72O2HfVI/update-insert-row-sql.aspx</link><feedburner:origLink>http://dotnettipoftheday.org/tips/update-insert-row-sql.aspx</feedburner:origLink></item>
    <item>
      <title>Improve your code readability: make more sense to conditions</title>
      <description>&lt;p&gt;Instead of:&lt;/p&gt;

&lt;div style="font-family: Courier New; font-size: 10pt; color: black; background: white;"&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;if&lt;/span&gt; (!&lt;span style="color: blue;"&gt;string&lt;/span&gt;.IsNullOrEmpty(state) &amp;amp;&amp;amp; state.Length == 2)&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;do this:&lt;/p&gt;

&lt;div style="font-family: Courier New; font-size: 10pt; color: black; background: white;"&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;bool&lt;/span&gt; stateIsValid = !&lt;span style="color: blue;"&gt;string&lt;/span&gt;.IsNullOrEmpty(state) &amp;amp;&amp;amp; state.Length == 2;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;if&lt;/span&gt; (stateIsValid)&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;/div&gt;

&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=make-more-sense-to-conditions"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=make-more-sense-to-conditions" border="0"/&gt;&lt;/a&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=IZ6yGNs2Tow:Swmmcz7x8II:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=IZ6yGNs2Tow:Swmmcz7x8II:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=IZ6yGNs2Tow:Swmmcz7x8II:XQ266DUsA9M"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=XQ266DUsA9M" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=IZ6yGNs2Tow:Swmmcz7x8II:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=IZ6yGNs2Tow:Swmmcz7x8II:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=IZ6yGNs2Tow:Swmmcz7x8II:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=IZ6yGNs2Tow:Swmmcz7x8II:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=IZ6yGNs2Tow:Swmmcz7x8II:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=IZ6yGNs2Tow:Swmmcz7x8II:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=IZ6yGNs2Tow:Swmmcz7x8II:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotNetTipOfTheDay/~4/IZ6yGNs2Tow" height="1" width="1"/&gt;</description>
      <guid isPermaLink="false">http://dotnettipoftheday.org/tips/make-more-sense-to-conditions.aspx</guid>
      <pubDate>Thu, 15 Nov 2007 21:48:00 GMT</pubDate>
      <wfw:commentRss>http://dotnettipoftheday.org/tips/CommentsRss.aspx?tipid=make-more-sense-to-conditions</wfw:commentRss>
    <link>http://feedproxy.google.com/~r/dotNetTipOfTheDay/~3/IZ6yGNs2Tow/make-more-sense-to-conditions.aspx</link><feedburner:origLink>http://dotnettipoftheday.org/tips/make-more-sense-to-conditions.aspx</feedburner:origLink></item>
    <item>
      <title>Speed up inserting records into database with SqlBulkCopy class</title>
      <description>&lt;p&gt;When you need to insert a great deal of rows into database (for example, when importing data from a flat file or when importing data from one database into another one), and you need to do it programmatically because it needs to be pre-processed on the fly, then you should use &lt;a href="http://msdn2.microsoft.com/en-us/library/system.data.sqlclient.sqlbulkcopy.aspx"&gt;SqlBulkCopy&lt;/a&gt; class.&lt;/p&gt;
&lt;p&gt;The class uses &lt;a href="http://en.wikipedia.org/wiki/Tabular_Data_Stream"&gt;Tabular Data Stream&lt;/a&gt; for fast transmitting data from client to a database server (therefore you'll see a bunch of "strange" INSERT BULK statements in a SQL Profiler):&lt;/p&gt;

&lt;div style="font-family: Courier New; font-size: 10pt; color: black; background: white;"&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #2b91af;"&gt;DataTable&lt;/span&gt; dataTable = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;DataTable&lt;/span&gt;();&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;using&lt;/span&gt; (&lt;span style="color: #2b91af;"&gt;SqlBulkCopy&lt;/span&gt; bulkCopy = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;SqlBulkCopy&lt;/span&gt;(connection))&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; bulkCopy.DestinationTableName = &lt;span style="color: #a31515;"&gt;"dbo.DestinationTale"&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; bulkCopy.WriteToServer(dataTable);&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Also try different values for &lt;a href="http://msdn2.microsoft.com/en-us/library/system.data.sqlclient.sqlbulkcopy.batchsize.aspx"&gt;SqlBulkCopy.BatchSize&lt;/a&gt; to adjust performance for your case.&lt;/p&gt;
&lt;p style="margin-top:30px"&gt;P.S. the tip applies only to MS SQL Server.&lt;/p&gt;&lt;br /&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=sqlbulkcopy"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=sqlbulkcopy" border="0"/&gt;&lt;/a&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=NLIhvLayngw:NpWXDem4RSQ:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=NLIhvLayngw:NpWXDem4RSQ:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=NLIhvLayngw:NpWXDem4RSQ:XQ266DUsA9M"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=XQ266DUsA9M" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=NLIhvLayngw:NpWXDem4RSQ:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=NLIhvLayngw:NpWXDem4RSQ:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=NLIhvLayngw:NpWXDem4RSQ:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=NLIhvLayngw:NpWXDem4RSQ:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=NLIhvLayngw:NpWXDem4RSQ:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=NLIhvLayngw:NpWXDem4RSQ:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=NLIhvLayngw:NpWXDem4RSQ:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotNetTipOfTheDay/~4/NLIhvLayngw" height="1" width="1"/&gt;</description>
      <guid isPermaLink="false">http://dotnettipoftheday.org/tips/sqlbulkcopy.aspx</guid>
      <pubDate>Wed, 14 Nov 2007 15:46:00 GMT</pubDate>
      <wfw:commentRss>http://dotnettipoftheday.org/tips/CommentsRss.aspx?tipid=sqlbulkcopy</wfw:commentRss>
    <link>http://feedproxy.google.com/~r/dotNetTipOfTheDay/~3/NLIhvLayngw/sqlbulkcopy.aspx</link><feedburner:origLink>http://dotnettipoftheday.org/tips/sqlbulkcopy.aspx</feedburner:origLink></item>
    <item>
      <title>Create elegant code with Action delegate and List.ForEach method</title>
      <description>&lt;p&gt;Let's review the following code which works with generic collection:&lt;/p&gt;

&lt;div style="font-family: Courier New; font-size: 10pt; color: black; background: white;"&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #2b91af;"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="color: #2b91af;"&gt;Tip&lt;/span&gt;&amp;gt; tips = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="color: #2b91af;"&gt;Tip&lt;/span&gt;&amp;gt;();&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: green;"&gt;//represents a list of Tips&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: green;"&gt;//create SiteMapNode from each Tip&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;foreach&lt;/span&gt; (&lt;span style="color: #2b91af;"&gt;Tip&lt;/span&gt; tip &lt;span style="color: blue;"&gt;in&lt;/span&gt; tips)&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;string&lt;/span&gt; url = &lt;span style="color: blue;"&gt;string&lt;/span&gt;.Format(&lt;span style="color: #a31515;"&gt;"{0}/tips/{1}.aspx"&lt;/span&gt;, appPath, tip.Id);&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #2b91af;"&gt;SiteMapNode&lt;/span&gt; node = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;SiteMapNode&lt;/span&gt;(&lt;span style="color: blue;"&gt;this&lt;/span&gt;, url, url, tip.Title);&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; node[&lt;span style="color: #a31515;"&gt;"lastmod"&lt;/span&gt;] = tip.PubDate.ToString(&lt;span style="color: #a31515;"&gt;"u"&lt;/span&gt;);&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; AddNode(node, rootNode);&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Although this code works well we can improve it using &lt;a href="http://msdn2.microsoft.com/en-us/library/018hxwa8.aspx"&gt;Action&lt;/a&gt; delegate and &lt;a href="http://msdn2.microsoft.com/en-us/library/bwabdf9z.aspx"&gt;List.ForEach&lt;/a&gt; method. First we have to exctract code to create SiteMapNode into a method:&lt;/p&gt;

&lt;div style="font-family: Courier New; font-size: 10pt; color: black; background: white;"&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;private&lt;/span&gt; &lt;span style="color: blue;"&gt;void&lt;/span&gt; AddSiteMapNode(&lt;span style="color: #2b91af;"&gt;Tip&lt;/span&gt; tip)&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;string&lt;/span&gt; url = &lt;span style="color: blue;"&gt;string&lt;/span&gt;.Format(&lt;span style="color: #a31515;"&gt;"{0}/tips/{1}.aspx"&lt;/span&gt;, appPath, tip.Id);&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #2b91af;"&gt;SiteMapNode&lt;/span&gt; node = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;SiteMapNode&lt;/span&gt;(&lt;span style="color: blue;"&gt;this&lt;/span&gt;, url, url, tip.Title);&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; node[&lt;span style="color: #a31515;"&gt;"lastmod"&lt;/span&gt;] = tip.PubDate.ToString(&lt;span style="color: #a31515;"&gt;"u"&lt;/span&gt;);&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; AddNode(node, rootNode);&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Separating it into a separate method has a few advantages, practically the ability to reuse the same logic for other uses. Now once we have this method 
creating SiteMapNode's from Tips collection would be:&lt;/p&gt;

&lt;div style="font-family: Courier New; font-size: 10pt; color: black; background: white;"&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; tips.ForEach(AddSiteMapNode);&lt;/p&gt;
&lt;/div&gt;

&lt;p style="margin-top:30px"&gt;P.S. this tip also can be used with &lt;a href="http://msdn2.microsoft.com/en-us/library/zecdkyw2.aspx"&gt;Array.ForEach&lt;/a&gt; method.&lt;/p&gt;

&lt;br /&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=action_delegate_with_foreach"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=action_delegate_with_foreach" border="0"/&gt;&lt;/a&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=o1UZ6Ieu1jY:Jm1YkBAYh3s:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=o1UZ6Ieu1jY:Jm1YkBAYh3s:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=o1UZ6Ieu1jY:Jm1YkBAYh3s:XQ266DUsA9M"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=XQ266DUsA9M" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=o1UZ6Ieu1jY:Jm1YkBAYh3s:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=o1UZ6Ieu1jY:Jm1YkBAYh3s:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=o1UZ6Ieu1jY:Jm1YkBAYh3s:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=o1UZ6Ieu1jY:Jm1YkBAYh3s:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=o1UZ6Ieu1jY:Jm1YkBAYh3s:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=o1UZ6Ieu1jY:Jm1YkBAYh3s:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=o1UZ6Ieu1jY:Jm1YkBAYh3s:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotNetTipOfTheDay/~4/o1UZ6Ieu1jY" height="1" width="1"/&gt;</description>
      <guid isPermaLink="false">http://dotnettipoftheday.org/tips/action_delegate_with_foreach.aspx</guid>
      <pubDate>Sun, 11 Nov 2007 01:31:00 GMT</pubDate>
      <wfw:commentRss>http://dotnettipoftheday.org/tips/CommentsRss.aspx?tipid=action_delegate_with_foreach</wfw:commentRss>
    <link>http://feedproxy.google.com/~r/dotNetTipOfTheDay/~3/o1UZ6Ieu1jY/action_delegate_with_foreach.aspx</link><feedburner:origLink>http://dotnettipoftheday.org/tips/action_delegate_with_foreach.aspx</feedburner:origLink></item>
    <item>
      <title>Disable Submit button after it was clicked</title>
      <description>&lt;p&gt;While submitting the form data to a server to be handled by the Click event of Submit button, it would be a good practice to disable the button. Here is a small code sample to achieve this:&lt;/p&gt;

&lt;div style="font-family: Courier New; font-size: 10pt; color: black; background: white;"&gt;
&lt;p style="margin: 0px;"&gt;btnSubmit.OnClientClick = ClientScript.GetPostBackEventReference(btnSubmit, &lt;span style="color: #a31515;"&gt;""&lt;/span&gt;) + &lt;span style="color: #a31515;"&gt;"; this.value='Submitting...';this.disabled = true;"&lt;/span&gt;;&lt;/p&gt;
&lt;/div&gt;

&lt;p style="margin-top:40px"&gt;Note: don't apply the tip to buttons which cause validation. Such buttons require more advanced onclick handler which checks client-side validation result.&lt;/p&gt;
&lt;p style="font-style:italic"&gt;submitted by Mustafa Basgun&lt;/p&gt;&lt;br /&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=disable_submit_button_after_click"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=disable_submit_button_after_click" border="0"/&gt;&lt;/a&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=u8PgbxIdtyc:VvMQcwAa-Uc:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=u8PgbxIdtyc:VvMQcwAa-Uc:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=u8PgbxIdtyc:VvMQcwAa-Uc:XQ266DUsA9M"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=XQ266DUsA9M" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=u8PgbxIdtyc:VvMQcwAa-Uc:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=u8PgbxIdtyc:VvMQcwAa-Uc:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=u8PgbxIdtyc:VvMQcwAa-Uc:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=u8PgbxIdtyc:VvMQcwAa-Uc:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=u8PgbxIdtyc:VvMQcwAa-Uc:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=u8PgbxIdtyc:VvMQcwAa-Uc:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=u8PgbxIdtyc:VvMQcwAa-Uc:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotNetTipOfTheDay/~4/u8PgbxIdtyc" height="1" width="1"/&gt;</description>
      <guid isPermaLink="false">http://dotnettipoftheday.org/tips/disable_submit_button_after_click.aspx</guid>
      <pubDate>Tue, 06 Nov 2007 13:42:00 GMT</pubDate>
      <wfw:commentRss>http://dotnettipoftheday.org/tips/CommentsRss.aspx?tipid=disable_submit_button_after_click</wfw:commentRss>
    <link>http://feedproxy.google.com/~r/dotNetTipOfTheDay/~3/u8PgbxIdtyc/disable_submit_button_after_click.aspx</link><feedburner:origLink>http://dotnettipoftheday.org/tips/disable_submit_button_after_click.aspx</feedburner:origLink></item>
    <item>
      <title>News: Now you can comment on .NET tips</title>
      <description>&lt;a href="http://dotnettipoftheday.org"&gt;.NET Tip of The Day.org&lt;/a&gt; got a new feature – you can comment on tips. Click on &lt;em&gt;Comments&lt;/em&gt; link to leave your comment.&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=fC3fkcb6Zj8:dsFW6iAM5l8:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=fC3fkcb6Zj8:dsFW6iAM5l8:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=fC3fkcb6Zj8:dsFW6iAM5l8:XQ266DUsA9M"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=XQ266DUsA9M" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=fC3fkcb6Zj8:dsFW6iAM5l8:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=fC3fkcb6Zj8:dsFW6iAM5l8:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=fC3fkcb6Zj8:dsFW6iAM5l8:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=fC3fkcb6Zj8:dsFW6iAM5l8:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=fC3fkcb6Zj8:dsFW6iAM5l8:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotNetTipOfTheDay/~4/fC3fkcb6Zj8" height="1" width="1"/&gt;</description>
      <guid isPermaLink="false">http://dotnettipoftheday.org/news.aspx#2007-11-06</guid>
      <pubDate>Tue, 06 Nov 2007 20:24:00 GMT</pubDate>
    <link>http://feedproxy.google.com/~r/dotNetTipOfTheDay/~3/fC3fkcb6Zj8/news.aspx</link><feedburner:origLink>http://dotnettipoftheday.org/news.aspx#2007-11-06</feedburner:origLink></item>
    <item>
      <title>Setting focus during a validation error</title>
      <description>&lt;p&gt;The validation controls now (starting with ASP.NET 2.0) allow you to easily set focus on a control in error using the &lt;a href="http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.basevalidator.setfocusonerror.aspx"&gt;SetFocusOnError&lt;/a&gt; property:&lt;/p&gt;

&lt;div style="font-family: Courier New; font-size: 10pt; color: black; background: white;"&gt;
	&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;asp&lt;/span&gt;&lt;span style="color:blue;"&gt;:&lt;/span&gt;&lt;span style="color:#a31515"&gt;RequiredFieldValidator&lt;/span&gt;&lt;/p&gt;
	&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:Red"&gt;SetFocusOnError&lt;/span&gt;&lt;span style="color:Blue"&gt;="true"&lt;/span&gt;&lt;/p&gt;
	&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:Red"&gt;ErrorMessage&lt;/span&gt;&lt;span style="color:Blue"&gt;="Enter something"&lt;/span&gt; &lt;span style="color:Red"&gt;ControlToValidate&lt;/span&gt;&lt;span style="color:Blue"&gt;="TextBox1"&lt;/span&gt;
	&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style="color:Red"&gt;runat&lt;/span&gt;&lt;span style="color:Blue"&gt;="server" /&amp;gt;&lt;/span&gt;&lt;/p&gt; 
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=validator_setfocusonerror"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=validator_setfocusonerror" border="0"/&gt;&lt;/a&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=eLJyPd33sJg:JS2_ht_WW_M:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=eLJyPd33sJg:JS2_ht_WW_M:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=eLJyPd33sJg:JS2_ht_WW_M:XQ266DUsA9M"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=XQ266DUsA9M" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=eLJyPd33sJg:JS2_ht_WW_M:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=eLJyPd33sJg:JS2_ht_WW_M:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=eLJyPd33sJg:JS2_ht_WW_M:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=eLJyPd33sJg:JS2_ht_WW_M:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=eLJyPd33sJg:JS2_ht_WW_M:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=eLJyPd33sJg:JS2_ht_WW_M:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=eLJyPd33sJg:JS2_ht_WW_M:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotNetTipOfTheDay/~4/eLJyPd33sJg" height="1" width="1"/&gt;</description>
      <guid isPermaLink="false">http://dotnettipoftheday.org/tips/validator_setfocusonerror.aspx</guid>
      <pubDate>Thu, 01 Nov 2007 15:54:00 GMT</pubDate>
      <wfw:commentRss>http://dotnettipoftheday.org/tips/CommentsRss.aspx?tipid=validator_setfocusonerror</wfw:commentRss>
    <link>http://feedproxy.google.com/~r/dotNetTipOfTheDay/~3/eLJyPd33sJg/validator_setfocusonerror.aspx</link><feedburner:origLink>http://dotnettipoftheday.org/tips/validator_setfocusonerror.aspx</feedburner:origLink></item>
    <item>
      <title>Which is better: Control or WebControl?</title>
      <description>&lt;p&gt;The &lt;a href="http://msdn2.microsoft.com/en-us/library/system.web.ui.control.aspx"&gt;System.Web.UI.Control&lt;/a&gt; class is the base class for all server controls. This provides the properties, methods, and events shared by all web controls. The &lt;a href="http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.webcontrol.aspx"&gt;System.Web.UI.WebControls.WebControl&lt;/a&gt; class derives from the Control class and adds style properties such as Font, Forecolor, and Backcolor.&lt;/p&gt;

&lt;p&gt;Microsoft recommends:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;if your custom control contains no user interface elements then derive from Control Class.&lt;/li&gt;
&lt;li&gt;if your custom control provides a user interface, then derive from WebControl class.&lt;/li&gt;
&lt;/ul&gt;
&lt;p style="font-style:italic; margin-top:50px;"&gt;submitted by Lohith Bandrehalli&lt;/p&gt;&lt;br /&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=control_vs_webcontrol"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=control_vs_webcontrol" border="0"/&gt;&lt;/a&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=t2-xmQNnwGw:WaVAV9049m0:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=t2-xmQNnwGw:WaVAV9049m0:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=t2-xmQNnwGw:WaVAV9049m0:XQ266DUsA9M"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=XQ266DUsA9M" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=t2-xmQNnwGw:WaVAV9049m0:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=t2-xmQNnwGw:WaVAV9049m0:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=t2-xmQNnwGw:WaVAV9049m0:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=t2-xmQNnwGw:WaVAV9049m0:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=t2-xmQNnwGw:WaVAV9049m0:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=t2-xmQNnwGw:WaVAV9049m0:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=t2-xmQNnwGw:WaVAV9049m0:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotNetTipOfTheDay/~4/t2-xmQNnwGw" height="1" width="1"/&gt;</description>
      <guid isPermaLink="false">http://dotnettipoftheday.org/tips/control_vs_webcontrol.aspx</guid>
      <pubDate>Tue, 30 Oct 2007 13:28:00 GMT</pubDate>
      <wfw:commentRss>http://dotnettipoftheday.org/tips/CommentsRss.aspx?tipid=control_vs_webcontrol</wfw:commentRss>
    <link>http://feedproxy.google.com/~r/dotNetTipOfTheDay/~3/t2-xmQNnwGw/control_vs_webcontrol.aspx</link><feedburner:origLink>http://dotnettipoftheday.org/tips/control_vs_webcontrol.aspx</feedburner:origLink></item>
    <item>
      <title>Handling errors at the method level</title>
      <description>&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;If potential errors are recoverable in the routine&lt;/strong&gt;&lt;br /&gt;
Use a combination of try…Catch blocks as a retry mechanism for error handling.&lt;/li&gt;

&lt;li&gt;&lt;strong&gt;If useful information can be added to the exception&lt;/strong&gt;&lt;br /&gt;
Create and throw a new exception with the added information.&lt;/li&gt;

&lt;li&gt;&lt;strong&gt;If cleanup is required&lt;/strong&gt;&lt;br /&gt;
Perform it in the finally block.&lt;/li&gt;

&lt;li&gt;&lt;strong&gt;If potential errors are not recoverable in the routine&lt;/strong&gt;&lt;br /&gt;
Recovery should be handled by the calling routine and its error-handling structure.&lt;/li&gt;
&lt;/ol&gt;

&lt;p style="font-style:italic"&gt;submitted by Lohith Bandrehalli&lt;/p&gt;&lt;br /&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=handling_errors_at_the_method_level"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=handling_errors_at_the_method_level" border="0"/&gt;&lt;/a&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=QSqiJNxW-K0:rT-roNYLQ1w:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=QSqiJNxW-K0:rT-roNYLQ1w:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=QSqiJNxW-K0:rT-roNYLQ1w:XQ266DUsA9M"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=XQ266DUsA9M" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=QSqiJNxW-K0:rT-roNYLQ1w:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=QSqiJNxW-K0:rT-roNYLQ1w:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=QSqiJNxW-K0:rT-roNYLQ1w:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=QSqiJNxW-K0:rT-roNYLQ1w:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=QSqiJNxW-K0:rT-roNYLQ1w:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=QSqiJNxW-K0:rT-roNYLQ1w:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=QSqiJNxW-K0:rT-roNYLQ1w:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotNetTipOfTheDay/~4/QSqiJNxW-K0" height="1" width="1"/&gt;</description>
      <guid isPermaLink="false">http://dotnettipoftheday.org/tips/handling_errors_at_the_method_level.aspx</guid>
      <pubDate>Sun, 28 Oct 2007 15:17:00 GMT</pubDate>
      <wfw:commentRss>http://dotnettipoftheday.org/tips/CommentsRss.aspx?tipid=handling_errors_at_the_method_level</wfw:commentRss>
    <link>http://feedproxy.google.com/~r/dotNetTipOfTheDay/~3/QSqiJNxW-K0/handling_errors_at_the_method_level.aspx</link><feedburner:origLink>http://dotnettipoftheday.org/tips/handling_errors_at_the_method_level.aspx</feedburner:origLink></item>
    <item>
      <title>How to call a surrogate for Dispose() on StringBuilder objects</title>
      <description>&lt;p&gt;A typical use for the StringBuilder type looks like below:&lt;/p&gt;

&lt;div style="font-family: Courier New; font-size: 10pt; color: black; background: white;"&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;class&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;Program&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;static&lt;/span&gt; &lt;span style="color: blue;"&gt;string&lt;/span&gt; UseStringBuilder(&lt;span style="color: blue;"&gt;string&lt;/span&gt; token)&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #2b91af;"&gt;StringBuilder&lt;/span&gt; sb = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;StringBuilder&lt;/span&gt;();&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;int&lt;/span&gt; i = 10;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;while&lt;/span&gt; (i-- &amp;gt; 0)&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; sb.Append(token + &lt;span style="color: #a31515;"&gt;'\n'&lt;/span&gt;);&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;string&lt;/span&gt; result = sb.ToString();&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;return&lt;/span&gt; result;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;static&lt;/span&gt; &lt;span style="color: blue;"&gt;void&lt;/span&gt; Main(&lt;span style="color: blue;"&gt;string&lt;/span&gt;[] args)&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #2b91af;"&gt;Console&lt;/span&gt;.WriteLine(UseStringBuilder(&lt;span style="color: #a31515;"&gt;"first"&lt;/span&gt;));&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #2b91af;"&gt;Console&lt;/span&gt;.WriteLine(UseStringBuilder(&lt;span style="color: #a31515;"&gt;"second"&lt;/span&gt;));&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;The issue with this code is that when sb goes out of scope it is mark for garbage collection, but the memory stored in it lingers until the garbage collector invokes its finalizer. That could amount to a lot of unused memory and hence might cost you some unnecessary garbage collections by the CLR. Given this behavior it would only look natural to call something like Dispose to take care of the underline memory buffer used in the StringBuilder.&lt;/p&gt;
&lt;p&gt;Unfortunately there is no Dispose method for this class, or any method to hint at freeing this unused memory in a deterministic way. The trick to get rid of this memory without invoking the finalizer is to set the Length to 0. The efficient code will become:&lt;/p&gt;

&lt;div style="font-family: Courier New; font-size: 10pt; color: black; background: white;"&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;class&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;Program&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;static&lt;/span&gt; &lt;span style="color: blue;"&gt;string&lt;/span&gt; UseStringBuilder(&lt;span style="color: blue;"&gt;string&lt;/span&gt; token)&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #2b91af;"&gt;StringBuilder&lt;/span&gt; sb = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;StringBuilder&lt;/span&gt;();&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;int&lt;/span&gt; i = 10;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;while&lt;/span&gt; (i-- &amp;gt; 0)&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; sb.Append(token + &lt;span style="color: #a31515;"&gt;'\n'&lt;/span&gt;);&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;string&lt;/span&gt; result = sb.ToString();&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; sb.Length = 0;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: green;"&gt;// this is the Dispose equivalent&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;return&lt;/span&gt; result;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;static&lt;/span&gt; &lt;span style="color: blue;"&gt;void&lt;/span&gt; Main(&lt;span style="color: blue;"&gt;string&lt;/span&gt;[] args)&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #2b91af;"&gt;Console&lt;/span&gt;.WriteLine(UseStringBuilder(&lt;span style="color: #a31515;"&gt;"first"&lt;/span&gt;));&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: green;"&gt;//no need to call System.GC.Collect() for the unreferenced StringBuilder object&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #2b91af;"&gt;Console&lt;/span&gt;.WriteLine(UseStringBuilder(&lt;span style="color: #a31515;"&gt;"second"&lt;/span&gt;));&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;/div&gt;

&lt;p style="font-style:italic"&gt;via &lt;a href="http://www.codeproject.com/script/articles/list_articles.asp?userid=634640"&gt;Decebal Mihailescu&lt;/a&gt;&lt;/p&gt;

&lt;p style="margin-top:30px"&gt;&lt;strong&gt;Update:&lt;/strong&gt; use this trick with caution. There's no
guarantee that future implementations of the runtime will act
as described (tested only on .NET 2.0, 3.0 and 3.5). Only apply if you are working with big strings and have problems with memory/performance. Otherwise you will just complicate your code.&lt;br /&gt;
Thanks to Jeff Dean for pointing that out.&lt;/p&gt;&lt;br /&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=dispose_stringbuilder"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=dispose_stringbuilder" border="0"/&gt;&lt;/a&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=a_0eLhUKcck:5IzKY-dZ9KM:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=a_0eLhUKcck:5IzKY-dZ9KM:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=a_0eLhUKcck:5IzKY-dZ9KM:XQ266DUsA9M"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=XQ266DUsA9M" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=a_0eLhUKcck:5IzKY-dZ9KM:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=a_0eLhUKcck:5IzKY-dZ9KM:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=a_0eLhUKcck:5IzKY-dZ9KM:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=a_0eLhUKcck:5IzKY-dZ9KM:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=a_0eLhUKcck:5IzKY-dZ9KM:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=a_0eLhUKcck:5IzKY-dZ9KM:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=a_0eLhUKcck:5IzKY-dZ9KM:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotNetTipOfTheDay/~4/a_0eLhUKcck" height="1" width="1"/&gt;</description>
      <guid isPermaLink="false">http://dotnettipoftheday.org/tips/dispose_stringbuilder.aspx</guid>
      <pubDate>Fri, 26 Oct 2007 12:00:00 GMT</pubDate>
      <wfw:commentRss>http://dotnettipoftheday.org/tips/CommentsRss.aspx?tipid=dispose_stringbuilder</wfw:commentRss>
    <link>http://feedproxy.google.com/~r/dotNetTipOfTheDay/~3/a_0eLhUKcck/dispose_stringbuilder.aspx</link><feedburner:origLink>http://dotnettipoftheday.org/tips/dispose_stringbuilder.aspx</feedburner:origLink></item>
    <item>
      <title>How to determine whether a property or a method is more appropriate for your needs</title>
      <description>&lt;p&gt;Use a method when:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The operation is a conversion, such as &lt;strong&gt;Object.ToString&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;The operation is expensive enough that you want to communicate to the user that they should consider caching the result.&lt;/li&gt;
&lt;li&gt;Obtaining a property value using the &lt;strong&gt;get&lt;/strong&gt; accessor would have an observable side effect.&lt;/li&gt;
&lt;li&gt;Calling the member twice in succession produces different results.&lt;/li&gt;
&lt;li&gt;The order of execution is important. Note that a type's properties should be able to be set and retrieved in any order.&lt;/li&gt;
&lt;li&gt;The member returns an array. Properties that return arrays can be very misleading. Usually it is necessary to return a copy of the internal array so that the user cannot change internal state. This, coupled with the fact that a user can easily assume it is an indexed property, leads to inefficient code.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;P.S. this is not a comprehensive list of guidelines. See &lt;a href="http://msdn2.microsoft.com/en-us/library/czefa0ke(vs.71).aspx"&gt;Design Guidelines for Class Library Developers&lt;/a&gt; for more.&lt;/p&gt;&lt;br /&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=property_vs_method"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=property_vs_method" border="0"/&gt;&lt;/a&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=leAFFQSP6TE:jZORgWa2PhQ:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=leAFFQSP6TE:jZORgWa2PhQ:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=leAFFQSP6TE:jZORgWa2PhQ:XQ266DUsA9M"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=XQ266DUsA9M" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=leAFFQSP6TE:jZORgWa2PhQ:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=leAFFQSP6TE:jZORgWa2PhQ:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=leAFFQSP6TE:jZORgWa2PhQ:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=leAFFQSP6TE:jZORgWa2PhQ:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=leAFFQSP6TE:jZORgWa2PhQ:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=leAFFQSP6TE:jZORgWa2PhQ:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=leAFFQSP6TE:jZORgWa2PhQ:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotNetTipOfTheDay/~4/leAFFQSP6TE" height="1" width="1"/&gt;</description>
      <guid isPermaLink="false">http://dotnettipoftheday.org/tips/property_vs_method.aspx</guid>
      <pubDate>Thu, 18 Oct 2007 23:04:00 GMT</pubDate>
      <wfw:commentRss>http://dotnettipoftheday.org/tips/CommentsRss.aspx?tipid=property_vs_method</wfw:commentRss>
    <link>http://feedproxy.google.com/~r/dotNetTipOfTheDay/~3/leAFFQSP6TE/property_vs_method.aspx</link><feedburner:origLink>http://dotnettipoftheday.org/tips/property_vs_method.aspx</feedburner:origLink></item>
    <item>
      <title>Verbatim string literals</title>
      <description>&lt;p&gt;Verbatim string literal does not require the use of escape characters to define special characters. Instead, any information in the source code, including new lines, is included in the string. To define a string literal an @ symbol is placed before the opening quotation mark. Verbatim string literals are often used for specifying paths and multi-line strings:

&lt;div style="font-family: Consolas; font-size: 10pt; color: black; background: white;"&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;string&lt;/span&gt; path = &lt;span style="color: #a31515;"&gt;@"C:\Program Files\My Program"&lt;/span&gt;;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: green;"&gt;//verbatim literal&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;string&lt;/span&gt; path2 = &lt;span style="color: #a31515;"&gt;"C:\\Program Files\\My Program"&lt;/span&gt;;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;span style="color: green;"&gt;//regular literal&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;string&lt;/span&gt; msg = &lt;span style="color: #a31515;"&gt;@"Hello,&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #a31515;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; This is a multi-line string"&lt;/span&gt;;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: green;"&gt;//verbatim literal&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;string&lt;/span&gt; msg2 = &lt;span style="color: #a31515;"&gt;"Hello,\nThis is multi-line string"&lt;/span&gt;;&amp;nbsp;&amp;nbsp; &lt;span style="color: green;"&gt;//regular literal&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;P.S. the only character that requires a different action is the quotation mark itself, which must be entered twice to indicate a single character.&lt;/p&gt;&lt;br /&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=verbatim-string-literal"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=verbatim-string-literal" border="0"/&gt;&lt;/a&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=u_EBkvSixe4:KaXuGg_vndc:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=u_EBkvSixe4:KaXuGg_vndc:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=u_EBkvSixe4:KaXuGg_vndc:XQ266DUsA9M"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=XQ266DUsA9M" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=u_EBkvSixe4:KaXuGg_vndc:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=u_EBkvSixe4:KaXuGg_vndc:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=u_EBkvSixe4:KaXuGg_vndc:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=u_EBkvSixe4:KaXuGg_vndc:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=u_EBkvSixe4:KaXuGg_vndc:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=u_EBkvSixe4:KaXuGg_vndc:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=u_EBkvSixe4:KaXuGg_vndc:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotNetTipOfTheDay/~4/u_EBkvSixe4" height="1" width="1"/&gt;</description>
      <guid isPermaLink="false">http://dotnettipoftheday.org/tips/verbatim-string-literal.aspx</guid>
      <pubDate>Wed, 17 Oct 2007 13:45:00 GMT</pubDate>
      <wfw:commentRss>http://dotnettipoftheday.org/tips/CommentsRss.aspx?tipid=verbatim-string-literal</wfw:commentRss>
    <link>http://feedproxy.google.com/~r/dotNetTipOfTheDay/~3/u_EBkvSixe4/verbatim-string-literal.aspx</link><feedburner:origLink>http://dotnettipoftheday.org/tips/verbatim-string-literal.aspx</feedburner:origLink></item>
    <item>
      <title>News: Maintenance</title>
      <description>&lt;p&gt;Hi everyone,&lt;/p&gt;&lt;p&gt;I'm Kostya Ly and I develop .NET Tip of The Day.org. I want to confess a horrible mistake I made: articles in this RSS channel appear in reverse order. As a result, when new people subscribe they see the last article first. My first thought was "You must commit harakiri".&lt;br /&gt;But then a smarter idea visited my mind. I decided to fix the problem and republish RSS. As a result you might expresience some little problems with this RSS channel tomorrow. It is possible that old articles will appear as new one in your RSS reader (it depends on RSS reader you are using). But I have to do it. Sorry guys.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;Thanks,&lt;br /&gt;Kostya Ly&lt;/p&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=9JhT8ufmxS0:XBmI4QV0ubI:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=9JhT8ufmxS0:XBmI4QV0ubI:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=9JhT8ufmxS0:XBmI4QV0ubI:XQ266DUsA9M"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=XQ266DUsA9M" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=9JhT8ufmxS0:XBmI4QV0ubI:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=9JhT8ufmxS0:XBmI4QV0ubI:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=9JhT8ufmxS0:XBmI4QV0ubI:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=9JhT8ufmxS0:XBmI4QV0ubI:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=9JhT8ufmxS0:XBmI4QV0ubI:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotNetTipOfTheDay/~4/9JhT8ufmxS0" height="1" width="1"/&gt;</description>
      <guid isPermaLink="false">http://dotnettipoftheday.org/news.aspx#2007-10-15</guid>
      <pubDate>Mon, 15 Oct 2007 21:02:00 GMT</pubDate>
    <link>http://feedproxy.google.com/~r/dotNetTipOfTheDay/~3/9JhT8ufmxS0/news.aspx</link><feedburner:origLink>http://dotnettipoftheday.org/news.aspx#2007-10-15</feedburner:origLink></item>
    <item>
      <title>Speed up Visual Studio 2005</title>
      <description>&lt;ul&gt;
&lt;li&gt;Make sure Visual Studio 2005 SP1 is installed.&lt;/li&gt;
&lt;li&gt;Turn off animation.&lt;br /&gt;
 Go to &lt;strong&gt;Tools | Options | Environment&lt;/strong&gt; and uncheck &lt;strong&gt;Animate environment tools&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Disable Navigation Bar.&lt;br /&gt;
If you are using ReSharper, you don't need VS2005 to update the list of methods and fields at the top of the file (CTRL-F12 does this nicely). Go to &lt;strong&gt;Tools | Options | Text Editor | C#&lt;/strong&gt; and uncheck &lt;strong&gt;Navigation bar&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Turn off Track Changes.&lt;br /&gt;
Go to &lt;strong&gt;Tools | Options | Text Editor&lt;/strong&gt; and uncheck &lt;strong&gt;Track changes&lt;/strong&gt;. This will reduce overhead and speeds up IDE response.&lt;/li&gt;
&lt;li&gt;Turn off Track Active item.&lt;br /&gt;
This will turn off jumping in the explorer whenever you select different files in different projects. Go to &lt;strong&gt;Tools | Options | Projects and Solutions&lt;/strong&gt; and uncheck &lt;strong&gt;Track Active Item in Solution Explorer&lt;/strong&gt;. This will ensure that if you are moving across files in different projects, left pane will still be steady instead of jumping around.&lt;/li&gt;
&lt;li&gt;Turn off AutoToolboxPopulate.&lt;br /&gt;
There is an option in VS 2005 that will cause VS to automatically populate the toolbox with any controls you compile as part of your solution. This is a useful feature when developing controls since it updates them when you build, but it can cause VS to end up taking a long time in some circumstances. To disable this option, select the &lt;strong&gt;Tools | Options | Windows Forms Designer&lt;/strong&gt; and then set &lt;strong&gt;AutoToolboxPopulate&lt;/strong&gt; to False.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Also make sure you read tip &lt;a href="http://dotnettipoftheday.org/tips/optimize_launch_of_vs2005.aspx"&gt;Optimize the launch of the Visual Studio 2005&lt;/a&gt;.&lt;/p&gt;&lt;br /&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=speedup_visual_studio"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=speedup_visual_studio" border="0"/&gt;&lt;/a&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=yiifDnkxiqo:jhGVZAPdgEY:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=yiifDnkxiqo:jhGVZAPdgEY:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=yiifDnkxiqo:jhGVZAPdgEY:XQ266DUsA9M"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=XQ266DUsA9M" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=yiifDnkxiqo:jhGVZAPdgEY:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=yiifDnkxiqo:jhGVZAPdgEY:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=yiifDnkxiqo:jhGVZAPdgEY:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=yiifDnkxiqo:jhGVZAPdgEY:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=yiifDnkxiqo:jhGVZAPdgEY:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=yiifDnkxiqo:jhGVZAPdgEY:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=yiifDnkxiqo:jhGVZAPdgEY:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotNetTipOfTheDay/~4/yiifDnkxiqo" height="1" width="1"/&gt;</description>
      <guid isPermaLink="false">http://dotnettipoftheday.org/tips/speedup_visual_studio.aspx</guid>
      <pubDate>Wed, 10 Oct 2007 21:00:00 GMT</pubDate>
      <wfw:commentRss>http://dotnettipoftheday.org/tips/CommentsRss.aspx?tipid=speedup_visual_studio</wfw:commentRss>
    <link>http://feedproxy.google.com/~r/dotNetTipOfTheDay/~3/yiifDnkxiqo/speedup_visual_studio.aspx</link><feedburner:origLink>http://dotnettipoftheday.org/tips/speedup_visual_studio.aspx</feedburner:origLink></item>
    <item>
      <title>How to resolve relative url's without ResolveUrl</title>
      <description>&lt;p&gt;Sometimes you need to resolve relative url's without ResolveUrl. If the code is executing outside a Control, for example in an IHttpHandler or business layer code somewhere that has no reference to a Control, you can't call Control.ResolveUrl.&lt;/p&gt;
&lt;p&gt;The &lt;a href="http://msdn2.microsoft.com/en-us/library/system.web.virtualpathutility.aspx"&gt;System.Web.VirtualPathUtility&lt;/a&gt; class has some very useful method for converting from an app relative path to an absolute path:&lt;/p&gt;

&lt;div style="font-family: Consolas; font-size: 10pt; color: black; background: white;"&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;string&lt;/span&gt; absoluteUrl = &lt;span style="color: #2b91af;"&gt;VirtualPathUtility&lt;/span&gt;.ToAbsolute(relativeUrl);&lt;/p&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=VirtualPathUtility-ToAbsolute"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=VirtualPathUtility-ToAbsolute" border="0"/&gt;&lt;/a&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=pwkIltN2BLA:53Q6fg7JESQ:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=pwkIltN2BLA:53Q6fg7JESQ:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=pwkIltN2BLA:53Q6fg7JESQ:XQ266DUsA9M"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=XQ266DUsA9M" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=pwkIltN2BLA:53Q6fg7JESQ:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=pwkIltN2BLA:53Q6fg7JESQ:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=pwkIltN2BLA:53Q6fg7JESQ:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=pwkIltN2BLA:53Q6fg7JESQ:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=pwkIltN2BLA:53Q6fg7JESQ:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=pwkIltN2BLA:53Q6fg7JESQ:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=pwkIltN2BLA:53Q6fg7JESQ:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotNetTipOfTheDay/~4/pwkIltN2BLA" height="1" width="1"/&gt;</description>
      <guid isPermaLink="false">http://dotnettipoftheday.org/tips/VirtualPathUtility-ToAbsolute.aspx</guid>
      <pubDate>Mon, 08 Oct 2007 19:32:00 GMT</pubDate>
      <wfw:commentRss>http://dotnettipoftheday.org/tips/CommentsRss.aspx?tipid=VirtualPathUtility-ToAbsolute</wfw:commentRss>
    <link>http://feedproxy.google.com/~r/dotNetTipOfTheDay/~3/pwkIltN2BLA/VirtualPathUtility-ToAbsolute.aspx</link><feedburner:origLink>http://dotnettipoftheday.org/tips/VirtualPathUtility-ToAbsolute.aspx</feedburner:origLink></item>
    <item>
      <title>How to maintain the position of the scrollbar on postbacks (across the entire site)</title>
      <description>&lt;p&gt;&lt;a href="http://dotnettipoftheday.org/tips/maintain_scroll_position.aspx"&gt;Tip/Trick: How to maintain the position of the scrollbar on postbacks&lt;/a&gt;. In addition, Joe Levi &lt;a href="http://www.joelevi.com/blog/index.php/2007/10/02/how-to-maintain-the-position-of-the-scrollbar-on-postbacks-with-aspnet-20/"&gt;explains&lt;/a&gt; how to do this across the entire site:&lt;/p&gt;
&lt;cite&gt;If you would like to apply this behavior to your entire site simply modify the &amp;lt;pages /&amp;gt; entry of your &amp;lt;system.web /&amp;gt; section in your web.config file like so:&lt;/p&gt;
&lt;div style="font-family: Courier New; font-size: 10pt; color: black; background: white; text-align:center; font-style:italic"&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #a31515;"&gt;pages&lt;/span&gt;&lt;span style="color: blue;"&gt; &lt;/span&gt;&lt;span style="color: red;"&gt;maintainScrollPositionOnPostBack&lt;/span&gt;&lt;span style="color: blue;"&gt;=&lt;/span&gt;"&lt;span style="color: blue;"&gt;true&lt;/span&gt;"&lt;span style="color: blue;"&gt; /&amp;gt;&lt;/span&gt;
&lt;/div&gt;
&lt;/cite&gt;
&lt;p style="font-style:italic"&gt;via &lt;a href="http://www.JoeLevi.com"&gt;Joe Levi&lt;/a&gt;&lt;/p&gt;

&lt;br /&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=maintain-scrollbar-position-across-site"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=maintain-scrollbar-position-across-site" border="0"/&gt;&lt;/a&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=TooqLUqkn80:k_Z7p0MFOqM:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=TooqLUqkn80:k_Z7p0MFOqM:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=TooqLUqkn80:k_Z7p0MFOqM:XQ266DUsA9M"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=XQ266DUsA9M" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=TooqLUqkn80:k_Z7p0MFOqM:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=TooqLUqkn80:k_Z7p0MFOqM:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=TooqLUqkn80:k_Z7p0MFOqM:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=TooqLUqkn80:k_Z7p0MFOqM:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=TooqLUqkn80:k_Z7p0MFOqM:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=TooqLUqkn80:k_Z7p0MFOqM:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=TooqLUqkn80:k_Z7p0MFOqM:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotNetTipOfTheDay/~4/TooqLUqkn80" height="1" width="1"/&gt;</description>
      <guid isPermaLink="false">http://dotnettipoftheday.org/tips/maintain-scrollbar-position-across-site.aspx</guid>
      <pubDate>Thu, 04 Oct 2007 01:32:00 GMT</pubDate>
      <wfw:commentRss>http://dotnettipoftheday.org/tips/CommentsRss.aspx?tipid=maintain-scrollbar-position-across-site</wfw:commentRss>
    <link>http://feedproxy.google.com/~r/dotNetTipOfTheDay/~3/TooqLUqkn80/maintain-scrollbar-position-across-site.aspx</link><feedburner:origLink>http://dotnettipoftheday.org/tips/maintain-scrollbar-position-across-site.aspx</feedburner:origLink></item>
    <item>
      <title>Debugger variable $exception</title>
      <description>&lt;p&gt;If your catch block do nothing with caught exception you may declare block argument without name (to avoid warning message &lt;em&gt;"CS0168: The variable 'ex' is declared but never used"&lt;/em&gt;):&lt;/p&gt;
&lt;div style="font-family: Courier New; font-size: 10pt; color: black; background: white;"&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;try&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;catch&lt;/span&gt; (&lt;span style="color: #2b91af;"&gt;Exception&lt;/span&gt;)&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: green;"&gt;// deliberately suppressing all exceptions&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;But one day during debugging you may actually want to examine &lt;code&gt;Exception&lt;/code&gt;. Since you don't have variable where exception is stored you can use debugger variable &lt;strong&gt;$exception&lt;/strong&gt; provided by the Visual Studio.NET 2005 Debugger to examine the exception in a catch block. Just add it to Watch Window.&lt;/p&gt;&lt;br /&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=exception-debugger-variable"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=exception-debugger-variable" border="0"/&gt;&lt;/a&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=0-N5954uHLY:OuID7wdJv0s:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=0-N5954uHLY:OuID7wdJv0s:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=0-N5954uHLY:OuID7wdJv0s:XQ266DUsA9M"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=XQ266DUsA9M" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=0-N5954uHLY:OuID7wdJv0s:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=0-N5954uHLY:OuID7wdJv0s:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=0-N5954uHLY:OuID7wdJv0s:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=0-N5954uHLY:OuID7wdJv0s:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=0-N5954uHLY:OuID7wdJv0s:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=0-N5954uHLY:OuID7wdJv0s:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=0-N5954uHLY:OuID7wdJv0s:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotNetTipOfTheDay/~4/0-N5954uHLY" height="1" width="1"/&gt;</description>
      <guid isPermaLink="false">http://dotnettipoftheday.org/tips/exception-debugger-variable.aspx</guid>
      <pubDate>Wed, 03 Oct 2007 02:07:00 GMT</pubDate>
      <wfw:commentRss>http://dotnettipoftheday.org/tips/CommentsRss.aspx?tipid=exception-debugger-variable</wfw:commentRss>
    <link>http://feedproxy.google.com/~r/dotNetTipOfTheDay/~3/0-N5954uHLY/exception-debugger-variable.aspx</link><feedburner:origLink>http://dotnettipoftheday.org/tips/exception-debugger-variable.aspx</feedburner:origLink></item>
    <item>
      <title>Explicitly suppress and restore compiler warnings using the #pragma warning directive</title>
      <description>&lt;p&gt;C# 2.0 allows you to explicitly suppress and restore compiler warnings using the &lt;a href="http://msdn2.microsoft.com/en-us/library/441722ys(vs.80).aspx"&gt;#pragma warning&lt;/a&gt; directive:&lt;/p&gt;
&lt;div style="font-family: Courier New; font-size: 10pt; color: black; background: white;"&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: green;"&gt;// Disable "The private field 'MyClass._number' is never used" warning&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;#pragma&lt;/span&gt; warning disable 169&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;class&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;MyClass&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;{&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;int&lt;/span&gt; _number;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;}&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;#pragma&lt;/span&gt; warning restore 169&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;Disabling warnings should be generally discouraged in production code. It is intended only for analysis when trying to isolate a problem, or when you lay out the code and would like to get the initial code structure in place without having to polish it up first. In all other cases, avoid suppressing compiler warnings.&lt;/p&gt;&lt;br /&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=pragma_warning_disable"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=pragma_warning_disable" border="0"/&gt;&lt;/a&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=XW7B3509FpM:1sug8Gjz7Ts:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=XW7B3509FpM:1sug8Gjz7Ts:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=XW7B3509FpM:1sug8Gjz7Ts:XQ266DUsA9M"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=XQ266DUsA9M" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=XW7B3509FpM:1sug8Gjz7Ts:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=XW7B3509FpM:1sug8Gjz7Ts:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=XW7B3509FpM:1sug8Gjz7Ts:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=XW7B3509FpM:1sug8Gjz7Ts:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=XW7B3509FpM:1sug8Gjz7Ts:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=XW7B3509FpM:1sug8Gjz7Ts:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=XW7B3509FpM:1sug8Gjz7Ts:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotNetTipOfTheDay/~4/XW7B3509FpM" height="1" width="1"/&gt;</description>
      <guid isPermaLink="false">http://dotnettipoftheday.org/tips/pragma_warning_disable.aspx</guid>
      <pubDate>Sat, 29 Sep 2007 12:00:00 GMT</pubDate>
      <wfw:commentRss>http://dotnettipoftheday.org/tips/CommentsRss.aspx?tipid=pragma_warning_disable</wfw:commentRss>
    <link>http://feedproxy.google.com/~r/dotNetTipOfTheDay/~3/XW7B3509FpM/pragma_warning_disable.aspx</link><feedburner:origLink>http://dotnettipoftheday.org/tips/pragma_warning_disable.aspx</feedburner:origLink></item>
    <item>
      <title>Validate integer value before casting it to an Enum type</title>
      <description>&lt;p&gt;There is one thing you should watch out for when using enumerations. You can cast any integer to an Enum type and you will not get an exception message. Therefore if the value comes from an external source (for example, from user input) check it against an enum before casting. The easiest way to do it is to use &lt;a href="http://msdn2.microsoft.com/en-us/library/system.enum.isdefined.aspx"&gt;Enum.IsDefined&lt;/a&gt; method:&lt;/p&gt;
&lt;div style="font-family: Consolas; font-size: 10pt; color: black; background: white;"&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;int&lt;/span&gt; submitedValue = 123;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;if&lt;/span&gt; (&lt;span style="color: #2b91af;"&gt;Enum&lt;/span&gt;.IsDefined(&lt;span style="color: blue;"&gt;typeof&lt;/span&gt;(&lt;span style="color: #2b91af;"&gt;MyEnum&lt;/span&gt;), submitedValue))&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: green;"&gt;//do casting here&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;&lt;br /&gt;&lt;br /&gt;Note: because &lt;strong&gt;Enum.IsDefined&lt;/strong&gt; loads reflection it should be used with caution because of its performance penalty.&lt;/p&gt;

&lt;p&gt;&lt;br /&gt;via &lt;span style="font-style:italic"&gt;M. Parreira&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=validate_before_cast_enum_isdefined"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=validate_before_cast_enum_isdefined" border="0"/&gt;&lt;/a&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=IBOoSvqBVRU:ROb8yWi_YgY:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=IBOoSvqBVRU:ROb8yWi_YgY:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=IBOoSvqBVRU:ROb8yWi_YgY:XQ266DUsA9M"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=XQ266DUsA9M" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=IBOoSvqBVRU:ROb8yWi_YgY:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=IBOoSvqBVRU:ROb8yWi_YgY:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=IBOoSvqBVRU:ROb8yWi_YgY:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=IBOoSvqBVRU:ROb8yWi_YgY:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=IBOoSvqBVRU:ROb8yWi_YgY:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=IBOoSvqBVRU:ROb8yWi_YgY:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=IBOoSvqBVRU:ROb8yWi_YgY:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotNetTipOfTheDay/~4/IBOoSvqBVRU" height="1" width="1"/&gt;</description>
      <guid isPermaLink="false">http://dotnettipoftheday.org/tips/validate_before_cast_enum_isdefined.aspx</guid>
      <pubDate>Thu, 27 Sep 2007 19:27:00 GMT</pubDate>
      <wfw:commentRss>http://dotnettipoftheday.org/tips/CommentsRss.aspx?tipid=validate_before_cast_enum_isdefined</wfw:commentRss>
    <link>http://feedproxy.google.com/~r/dotNetTipOfTheDay/~3/IBOoSvqBVRU/validate_before_cast_enum_isdefined.aspx</link><feedburner:origLink>http://dotnettipoftheday.org/tips/validate_before_cast_enum_isdefined.aspx</feedburner:origLink></item>
    <item>
      <title>Return read-only collection if you want to control its modification</title>
      <description>&lt;p&gt;Let's review the following example:&lt;/p&gt;

&lt;div style="font-family: Courier New; font-size: 10pt; color: black; background: white;"&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;class&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;Order&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;{&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;private&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="color: #2b91af;"&gt;OrderItem&lt;/span&gt;&amp;gt; _orderItems = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="color: #2b91af;"&gt;OrderItem&lt;/span&gt;&amp;gt;();&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;ReadOnlyCollection&lt;/span&gt;&amp;lt;&lt;span style="color: #2b91af;"&gt;OrderItem&lt;/span&gt;&amp;gt; OrderItems&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;get&lt;/span&gt; { &lt;span style="color: blue;"&gt;return&lt;/span&gt; _orderItems.AsReadOnly(); }&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;void&lt;/span&gt; AddOrderItem(&lt;span style="color: #2b91af;"&gt;OrderItem&lt;/span&gt; orderItem)&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; _orderItems.Add(orderItem);&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;}&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;The class has a public property of a collection type and I want to have "controlled access" to this collection. What I mean is, that a consumer of these classes should not be able to add an &lt;code&gt;OrderItem&lt;/code&gt; to the collection directly, since some additional action(s) need to be executed. He should always use the &lt;code&gt;AddOrderItem&lt;/code&gt; method if he wants to add an &lt;code&gt;OrderItem&lt;/code&gt; to the &lt;code&gt;Order&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;In such cases keep the collection private, create the necessary methods to provide the necessary controlled access to the collection and create a public property which returns a read-only instance of the collection (by using &lt;a href="http://msdn2.microsoft.com/en-us/library/e78dcd75.aspx"&gt;List&amp;lt;T&amp;gt;.AsReadOnly&lt;/a&gt; method), so that you can iterate through the collection, change existing instances of objects within the collection, get the number of objects that are in the collection, etc.&lt;/p&gt;&lt;br /&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=collection_asreadonly"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=collection_asreadonly" border="0"/&gt;&lt;/a&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=SHGA6qZCWJo:kRu8aQFy58M:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=SHGA6qZCWJo:kRu8aQFy58M:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=SHGA6qZCWJo:kRu8aQFy58M:XQ266DUsA9M"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=XQ266DUsA9M" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=SHGA6qZCWJo:kRu8aQFy58M:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=SHGA6qZCWJo:kRu8aQFy58M:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=SHGA6qZCWJo:kRu8aQFy58M:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=SHGA6qZCWJo:kRu8aQFy58M:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=SHGA6qZCWJo:kRu8aQFy58M:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=SHGA6qZCWJo:kRu8aQFy58M:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=SHGA6qZCWJo:kRu8aQFy58M:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotNetTipOfTheDay/~4/SHGA6qZCWJo" height="1" width="1"/&gt;</description>
      <guid isPermaLink="false">http://dotnettipoftheday.org/tips/collection_asreadonly.aspx</guid>
      <pubDate>Wed, 26 Sep 2007 01:14:00 GMT</pubDate>
      <wfw:commentRss>http://dotnettipoftheday.org/tips/CommentsRss.aspx?tipid=collection_asreadonly</wfw:commentRss>
    <link>http://feedproxy.google.com/~r/dotNetTipOfTheDay/~3/SHGA6qZCWJo/collection_asreadonly.aspx</link><feedburner:origLink>http://dotnettipoftheday.org/tips/collection_asreadonly.aspx</feedburner:origLink></item>
    <item>
      <title>Create elegant code with generic collections and Predicate delegate</title>
      <description>&lt;p&gt;Let's review the following code which works with generic collection:&lt;/p&gt;

&lt;div style="font-family: Courier New; font-size: 10pt; color: black; background: white;"&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #2b91af;"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="color: #2b91af;"&gt;String&lt;/span&gt;&amp;gt; urls = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;List&lt;/span&gt;&amp;lt;&lt;span style="color: #2b91af;"&gt;String&lt;/span&gt;&amp;gt;();&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: green;"&gt;//represents a bunch of urls&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: green;"&gt;//Remove all urls that don't start with "http://"&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;for&lt;/span&gt; (&lt;span style="color: blue;"&gt;int&lt;/span&gt; i = urls.Count - 1; i &amp;gt;= 0; i--)&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;if&lt;/span&gt; (!urls[i].StartsWith(&lt;span style="color: #a31515;"&gt;"http://"&lt;/span&gt;, &lt;span style="color: #2b91af;"&gt;StringComparison&lt;/span&gt;.OrdinalIgnoreCase))&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; urls.RemoveAt(i);&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;This works well but we can do a little better using &lt;a href="http://msdn2.microsoft.com/en-us/library/bfcke1bz.aspx"&gt;Predicate&lt;/a&gt; (Predicate is essentially a delegate that allows us to filter based on a certain criteria). First, we have to define the method to be the predicate to validate that an url don't starts with an "http://". This would be:&lt;/p&gt;

&lt;div style="font-family: Courier New; font-size: 10pt; color: black; background: white;"&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;bool&lt;/span&gt; IsNonHttp(&lt;span style="color: blue;"&gt;string&lt;/span&gt; url)&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;return&lt;/span&gt; !url.StartsWith(&lt;span style="color: #a31515;"&gt;"http://"&lt;/span&gt;, &lt;span style="color: #2b91af;"&gt;StringComparison&lt;/span&gt;.OrdinalIgnoreCase);&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Which is essentially the same as the statement we had above. Separating it into a separate method has a few advantages, practically the ability to reuse the same logic for other uses. Now once we have this predicate removing all urls that don't start with an "http://" would be:&lt;/p&gt;

&lt;div style="font-family: Courier New; font-size: 10pt; color: black; background: white;"&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; urls.RemoveAll(IsNonHttp);&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;You can also write the whole thing in one line if you so choose by using an &lt;a href="http://msdn2.microsoft.com/en-us/library/0yw3tz5k(vs.80).aspx"&gt;anonymous delegate&lt;/a&gt; this way:&lt;/p&gt;

&lt;div style="font-family: Courier New; font-size: 10pt; color: black; background: white;"&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; urls.RemoveAll(&lt;span style="color: blue;"&gt;delegate&lt;/span&gt;(&lt;span style="color: blue;"&gt;string&lt;/span&gt; url) {&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;return&lt;/span&gt; !url.StartsWith(&lt;span style="color: #a31515;"&gt;"http://"&lt;/span&gt;, &lt;span style="color: #2b91af;"&gt;StringComparison&lt;/span&gt;.OrdinalIgnoreCase);&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Other methods of &lt;a href="http://msdn2.microsoft.com/en-us/library/6sh2ey19.aspx"&gt;List&amp;lt;T&amp;gt;&lt;/a&gt; which take a Predicate:
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;List.Exists&lt;/strong&gt; - determines whether the List contains elements that match the conditions defined by the specified predicate.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;List.Find&lt;/strong&gt; - searches for an element that matches the conditions defined by the specified predicate, and returns the first occurrence within the entire List.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;List.FindAll&lt;/strong&gt; - retrieves the all the elements that match the conditions defined by the specified predicate.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;List.FindIndex&lt;/strong&gt; - searches for an element that matches the conditions defined by a specified predicate, and returns the zero-based index of the first occurrence within the List or a portion of it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;List.FindLast&lt;/strong&gt; - searches for an element that matches the conditions defined by the specified predicate, and returns the last occurrence within the entire List.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;List.FindLastIndex&lt;/strong&gt; - searches for an element that matches the conditions defined by a specified predicate, and returns the zero-based index of the last occurrence within the List or a portion of it.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;List.TrueForAll&lt;/strong&gt; - determines whether every element in the List matches the conditions defined by the specified predicate.&lt;/li&gt;
&lt;/ul&gt;
&lt;/p&gt;&lt;br /&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=predicate_delegate"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=predicate_delegate" border="0"/&gt;&lt;/a&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=KRd8n-MKtE4:lUiIDdwnj3A:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=KRd8n-MKtE4:lUiIDdwnj3A:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=KRd8n-MKtE4:lUiIDdwnj3A:XQ266DUsA9M"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=XQ266DUsA9M" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=KRd8n-MKtE4:lUiIDdwnj3A:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=KRd8n-MKtE4:lUiIDdwnj3A:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=KRd8n-MKtE4:lUiIDdwnj3A:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=KRd8n-MKtE4:lUiIDdwnj3A:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=KRd8n-MKtE4:lUiIDdwnj3A:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=KRd8n-MKtE4:lUiIDdwnj3A:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=KRd8n-MKtE4:lUiIDdwnj3A:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotNetTipOfTheDay/~4/KRd8n-MKtE4" height="1" width="1"/&gt;</description>
      <guid isPermaLink="false">http://dotnettipoftheday.org/tips/predicate_delegate.aspx</guid>
      <pubDate>Sat, 22 Sep 2007 12:30:00 GMT</pubDate>
      <wfw:commentRss>http://dotnettipoftheday.org/tips/CommentsRss.aspx?tipid=predicate_delegate</wfw:commentRss>
    <link>http://feedproxy.google.com/~r/dotNetTipOfTheDay/~3/KRd8n-MKtE4/predicate_delegate.aspx</link><feedburner:origLink>http://dotnettipoftheday.org/tips/predicate_delegate.aspx</feedburner:origLink></item>
    <item>
      <title>Speed testing in .NET - System.Diagnostics.Stopwatch</title>
      <description>&lt;p&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/system.diagnostics.stopwatch.aspx"&gt;System.Diagnostics.Stopwatch&lt;/a&gt; is a replacement for what most people probably do to identify the time spent on excecuting a method. The process usually goes something like: create a DateTime.Now value at the start and then subtract the ending DateTime.Now to get the TimeDuration value that elapsed.&lt;/p&gt;
&lt;p&gt;As an alternative, the Stopwatch class was built using low-level API calls, with less overhead than other .NET methods. If the hardware and Windows version of the computer support a high-resolution performance counter, it will use this counter instead of the standard PC clock.&lt;/p&gt;
&lt;p&gt;Here is a simple example:&lt;/p&gt;
&lt;div style="font-family: Consolas; font-size: 10pt; color: black; background: white;"&gt;
&lt;p style="margin: 0px;"&gt;System.Diagnostics.&lt;span style="color: #2b91af;"&gt;Stopwatch&lt;/span&gt; watch = &lt;span style="color: blue;"&gt;new&lt;/span&gt; System.Diagnostics.&lt;span style="color: #2b91af;"&gt;Stopwatch&lt;/span&gt;();&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;watch.Start();&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: green;"&gt;//do my stuff&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt; ...&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;watch.Stop();&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;MessageBox&lt;/span&gt;.Show(&lt;span style="color: #a31515;"&gt;"Time spent: "&lt;/span&gt; + watch.Elapsed.ToString());&lt;/p&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=system_diagnostics_stopwatch"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=system_diagnostics_stopwatch" border="0"/&gt;&lt;/a&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=aULQQmJGfNg:SP_IYtfuImo:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=aULQQmJGfNg:SP_IYtfuImo:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=aULQQmJGfNg:SP_IYtfuImo:XQ266DUsA9M"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=XQ266DUsA9M" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=aULQQmJGfNg:SP_IYtfuImo:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=aULQQmJGfNg:SP_IYtfuImo:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=aULQQmJGfNg:SP_IYtfuImo:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=aULQQmJGfNg:SP_IYtfuImo:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=aULQQmJGfNg:SP_IYtfuImo:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=aULQQmJGfNg:SP_IYtfuImo:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=aULQQmJGfNg:SP_IYtfuImo:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotNetTipOfTheDay/~4/aULQQmJGfNg" height="1" width="1"/&gt;</description>
      <guid isPermaLink="false">http://dotnettipoftheday.org/tips/system_diagnostics_stopwatch.aspx</guid>
      <pubDate>Thu, 20 Sep 2007 15:57:00 GMT</pubDate>
      <wfw:commentRss>http://dotnettipoftheday.org/tips/CommentsRss.aspx?tipid=system_diagnostics_stopwatch</wfw:commentRss>
    <link>http://feedproxy.google.com/~r/dotNetTipOfTheDay/~3/aULQQmJGfNg/system_diagnostics_stopwatch.aspx</link><feedburner:origLink>http://dotnettipoftheday.org/tips/system_diagnostics_stopwatch.aspx</feedburner:origLink></item>
    <item>
      <title>Use Tab twice to get the code snippets that are available within code editor</title>
      <description>&lt;p&gt;Take for example of foreach loop, just press 2 tabs after typing "fore"... that's it you got the code snippet as mentioned below:&lt;/p&gt;
&lt;img src="http://dotnettipoftheday.org/resources/code_snippet.png" alt="foreach code snippet" /&gt;

&lt;p&gt;Other useful code snippets are:
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;for&lt;/code&gt; - for loop&lt;/li&gt;
&lt;li&gt;&lt;code&gt;while&lt;/code&gt; - for while loop&lt;/li&gt;
&lt;li&gt;&lt;code&gt;equals&lt;/code&gt; - snippet for implementing Equals() according to quidelines&lt;/li&gt;
&lt;li&gt;&lt;code&gt;prop&lt;/code&gt; - for public property and backing field&lt;/li&gt;
&lt;li&gt;&lt;code&gt;tryf&lt;/code&gt; - for try finally&lt;/li&gt;
&lt;li&gt;&lt;code&gt;indexer&lt;/code&gt; - for indexer&lt;/li&gt;
&lt;/ul&gt;
&lt;/p&gt;
&lt;p&gt;For more information on code snippets that are included in Visual C# by default, see &lt;a href="http://msdn2.microsoft.com/en-us/library/z41h7fat(VS.80).aspx"&gt;Default Code Snippets&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;via &lt;span style="font-style:italic"&gt;Chakravarthy,&lt;br /&gt; &lt;a href="http://www.inteqsolutions.com/"&gt;InteQ Solutions&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;br /&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=use_tab_twice_to_get_snippet"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=use_tab_twice_to_get_snippet" border="0"/&gt;&lt;/a&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=MNbPQ2vP-T4:ZTenub952nQ:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=MNbPQ2vP-T4:ZTenub952nQ:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=MNbPQ2vP-T4:ZTenub952nQ:XQ266DUsA9M"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=XQ266DUsA9M" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=MNbPQ2vP-T4:ZTenub952nQ:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=MNbPQ2vP-T4:ZTenub952nQ:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=MNbPQ2vP-T4:ZTenub952nQ:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=MNbPQ2vP-T4:ZTenub952nQ:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=MNbPQ2vP-T4:ZTenub952nQ:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=MNbPQ2vP-T4:ZTenub952nQ:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=MNbPQ2vP-T4:ZTenub952nQ:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotNetTipOfTheDay/~4/MNbPQ2vP-T4" height="1" width="1"/&gt;</description>
      <guid isPermaLink="false">http://dotnettipoftheday.org/tips/use_tab_twice_to_get_snippet.aspx</guid>
      <pubDate>Sat, 15 Sep 2007 19:11:00 GMT</pubDate>
      <wfw:commentRss>http://dotnettipoftheday.org/tips/CommentsRss.aspx?tipid=use_tab_twice_to_get_snippet</wfw:commentRss>
    <link>http://feedproxy.google.com/~r/dotNetTipOfTheDay/~3/MNbPQ2vP-T4/use_tab_twice_to_get_snippet.aspx</link><feedburner:origLink>http://dotnettipoftheday.org/tips/use_tab_twice_to_get_snippet.aspx</feedburner:origLink></item>
    <item>
      <title>?? operator (C#)</title>
      <description>&lt;p&gt;The &lt;strong&gt;??&lt;/strong&gt; operator returns the left-hand operand if it is not null, or else it returns the right operand. For example:&lt;/p&gt;
&lt;div style="font-family: Consolas; font-size: 10pt; color: black; background: white;"&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;int&lt;/span&gt;? x = &lt;span style="color: blue;"&gt;null&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: green;"&gt;// y = x, unless x is null, in which case y = -1.&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;int&lt;/span&gt; y = x ?? -1;&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;The &lt;strong&gt;??&lt;/strong&gt; operator also works with reference types:&lt;/p&gt;
&lt;div style="font-family: Consolas; font-size: 10pt; color: black; background: white;"&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: green;"&gt;//message = param, unless param is null&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: green;"&gt;//in which case message = "No message" &lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;string&lt;/span&gt; message = param ?? &lt;span style="color: #a31515;"&gt;"No message"&lt;/span&gt;;&lt;/p&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=double_question_mark_operator_cs"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=double_question_mark_operator_cs" border="0"/&gt;&lt;/a&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=eNJZmsizj2Y:mPGl7BLgr6s:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=eNJZmsizj2Y:mPGl7BLgr6s:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=eNJZmsizj2Y:mPGl7BLgr6s:XQ266DUsA9M"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=XQ266DUsA9M" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=eNJZmsizj2Y:mPGl7BLgr6s:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=eNJZmsizj2Y:mPGl7BLgr6s:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=eNJZmsizj2Y:mPGl7BLgr6s:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=eNJZmsizj2Y:mPGl7BLgr6s:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=eNJZmsizj2Y:mPGl7BLgr6s:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=eNJZmsizj2Y:mPGl7BLgr6s:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=eNJZmsizj2Y:mPGl7BLgr6s:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotNetTipOfTheDay/~4/eNJZmsizj2Y" height="1" width="1"/&gt;</description>
      <guid isPermaLink="false">http://dotnettipoftheday.org/tips/double_question_mark_operator_cs.aspx</guid>
      <pubDate>Thu, 13 Sep 2007 16:10:00 GMT</pubDate>
      <wfw:commentRss>http://dotnettipoftheday.org/tips/CommentsRss.aspx?tipid=double_question_mark_operator_cs</wfw:commentRss>
    <link>http://feedproxy.google.com/~r/dotNetTipOfTheDay/~3/eNJZmsizj2Y/double_question_mark_operator_cs.aspx</link><feedburner:origLink>http://dotnettipoftheday.org/tips/double_question_mark_operator_cs.aspx</feedburner:origLink></item>
    <item>
      <title>Optimize the launch of the Visual Studio 2005</title>
      <description>&lt;ul&gt;
&lt;li&gt;Disable "Start Page".
 &lt;ol&gt;
  &lt;li&gt;Go to &lt;strong&gt;Tools | Options&lt;/strong&gt;.&lt;/li&gt;
  &lt;li&gt;In &lt;strong&gt;Environment | Startup&lt;/strong&gt; section, change &lt;strong&gt;At startup&lt;/strong&gt; setting to &lt;strong&gt;Show empty environment&lt;/strong&gt;.&lt;/li&gt;
 &lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;Disable splash screen.
 &lt;ol&gt;
  &lt;li&gt;Open the properties of Visual Studio 2005 shortcut.&lt;/li&gt;
  &lt;li&gt;Add the parameter &lt;code&gt;/nosplash&lt;/code&gt; to the target.&lt;/li&gt;
 &lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;Close all unnecessary panels/tabs to prevent them from appearing when the IDE loads.&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=optimize_launch_of_vs2005"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=optimize_launch_of_vs2005" border="0"/&gt;&lt;/a&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=4zj872bEicI:1gUgVHaekmA:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=4zj872bEicI:1gUgVHaekmA:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=4zj872bEicI:1gUgVHaekmA:XQ266DUsA9M"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=XQ266DUsA9M" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=4zj872bEicI:1gUgVHaekmA:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=4zj872bEicI:1gUgVHaekmA:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=4zj872bEicI:1gUgVHaekmA:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=4zj872bEicI:1gUgVHaekmA:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=4zj872bEicI:1gUgVHaekmA:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=4zj872bEicI:1gUgVHaekmA:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=4zj872bEicI:1gUgVHaekmA:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotNetTipOfTheDay/~4/4zj872bEicI" height="1" width="1"/&gt;</description>
      <guid isPermaLink="false">http://dotnettipoftheday.org/tips/optimize_launch_of_vs2005.aspx</guid>
      <pubDate>Sun, 09 Sep 2007 16:22:00 GMT</pubDate>
      <wfw:commentRss>http://dotnettipoftheday.org/tips/CommentsRss.aspx?tipid=optimize_launch_of_vs2005</wfw:commentRss>
    <link>http://feedproxy.google.com/~r/dotNetTipOfTheDay/~3/4zj872bEicI/optimize_launch_of_vs2005.aspx</link><feedburner:origLink>http://dotnettipoftheday.org/tips/optimize_launch_of_vs2005.aspx</feedburner:origLink></item>
    <item>
      <title>Conditional breakpoints in Visual Studio</title>
      <description>&lt;p&gt;You can specify a breakpoint condition which will be evaluated when a breakpoint is reached. The debugger will break only if the condition is satisfied.&lt;/p&gt;
&lt;p&gt;To specify a condition:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;In a source window, right-click a line containing a breakpoint glyph and choose &lt;strong&gt;Condition&lt;/strong&gt; from &lt;strong&gt;Breakpoints&lt;/strong&gt; in the shortcut menu.
&lt;img style="margin-top:10px" src="http://dotnettipoftheday.org/resources/conditional_breakpoint.png" alt="Conditional Breakpoint" /&gt;
&lt;/li&gt;
&lt;li&gt;In the &lt;strong&gt;Breakpoint Condition&lt;/strong&gt; dialog box, define a boolean condition using the code in your local scope. For example, you can only break when _culture != "en-US".&lt;/li&gt;
&lt;li&gt;Choose &lt;strong&gt;Is true&lt;/strong&gt; if you want to break when the expression is satisfied or &lt;strong&gt;Has changed&lt;/strong&gt; if you want to break when the value of the expression has changed.&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;OK&lt;/strong&gt;.&lt;/li&gt;
&lt;/ol&gt;&lt;br /&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=conditional_breakpoint"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=conditional_breakpoint" border="0"/&gt;&lt;/a&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=TMYbgSyMKZo:mf5qqSy1qd8:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=TMYbgSyMKZo:mf5qqSy1qd8:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=TMYbgSyMKZo:mf5qqSy1qd8:XQ266DUsA9M"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=XQ266DUsA9M" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=TMYbgSyMKZo:mf5qqSy1qd8:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=TMYbgSyMKZo:mf5qqSy1qd8:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=TMYbgSyMKZo:mf5qqSy1qd8:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=TMYbgSyMKZo:mf5qqSy1qd8:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=TMYbgSyMKZo:mf5qqSy1qd8:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=TMYbgSyMKZo:mf5qqSy1qd8:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=TMYbgSyMKZo:mf5qqSy1qd8:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotNetTipOfTheDay/~4/TMYbgSyMKZo" height="1" width="1"/&gt;</description>
      <guid isPermaLink="false">http://dotnettipoftheday.org/tips/conditional_breakpoint.aspx</guid>
      <pubDate>Fri, 07 Sep 2007 00:00:00 GMT</pubDate>
      <wfw:commentRss>http://dotnettipoftheday.org/tips/CommentsRss.aspx?tipid=conditional_breakpoint</wfw:commentRss>
    <link>http://feedproxy.google.com/~r/dotNetTipOfTheDay/~3/TMYbgSyMKZo/conditional_breakpoint.aspx</link><feedburner:origLink>http://dotnettipoftheday.org/tips/conditional_breakpoint.aspx</feedburner:origLink></item>
    <item>
      <title>Use Path.GetRandomFileName() or Path.GetTempFileName() when working with temp files</title>
      <description>&lt;p&gt;Do not reinvent function for generating unique name for temporary files. Use one of the existing methods:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/system.io.path.gettempfilename.aspx"&gt;System.IO.Path.GetTempFileName()&lt;/a&gt; - use this method if you want to create temporary file in user's temp folder.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/system.io.path.getrandomfilename.aspx"&gt;System.IO.Path.GetRandomFileName()&lt;/a&gt; - use this method if you just want to generate unique file name.&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=PathGetRandomFileName"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=PathGetRandomFileName" border="0"/&gt;&lt;/a&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=QXe3sh-2_Cs:g87uINAehCY:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=QXe3sh-2_Cs:g87uINAehCY:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=QXe3sh-2_Cs:g87uINAehCY:XQ266DUsA9M"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=XQ266DUsA9M" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=QXe3sh-2_Cs:g87uINAehCY:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=QXe3sh-2_Cs:g87uINAehCY:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=QXe3sh-2_Cs:g87uINAehCY:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=QXe3sh-2_Cs:g87uINAehCY:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=QXe3sh-2_Cs:g87uINAehCY:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=QXe3sh-2_Cs:g87uINAehCY:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=QXe3sh-2_Cs:g87uINAehCY:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotNetTipOfTheDay/~4/QXe3sh-2_Cs" height="1" width="1"/&gt;</description>
      <guid isPermaLink="false">http://dotnettipoftheday.org/tips/PathGetRandomFileName.aspx</guid>
      <pubDate>Wed, 05 Sep 2007 20:27:00 GMT</pubDate>
      <wfw:commentRss>http://dotnettipoftheday.org/tips/CommentsRss.aspx?tipid=PathGetRandomFileName</wfw:commentRss>
    <link>http://feedproxy.google.com/~r/dotNetTipOfTheDay/~3/QXe3sh-2_Cs/PathGetRandomFileName.aspx</link><feedburner:origLink>http://dotnettipoftheday.org/tips/PathGetRandomFileName.aspx</feedburner:origLink></item>
    <item>
      <title>Consider using System.IO.Path.Combine() instead of string concatenation</title>
      <description>&lt;p&gt;Let's review the following code for creating a file path:&lt;/p&gt;

&lt;div style="font-family: Courier New; font-size: 10pt; color: black; background: white;"&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;string&lt;/span&gt; GetFullPath(&lt;span style="color: blue;"&gt;string&lt;/span&gt; fileName)&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;string&lt;/span&gt; folder = &lt;span style="color: #2b91af;"&gt;ConfigurationManager&lt;/span&gt;.AppSettings[&lt;span style="color: #a31515;"&gt;"MyFolder"&lt;/span&gt;];&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;return&lt;/span&gt; folder + fileName;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;This code is prone to error. For example, when you set the folder setting, you have to remember to make sure it ends with a slash. To avoid such problems use Path.Combine() method which will ensure that the folder has ending slash:&lt;/p&gt;

&lt;div style="font-family: Courier New; font-size: 10pt; color: black; background: white;"&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;string&lt;/span&gt; GetFullPath(&lt;span style="color: blue;"&gt;string&lt;/span&gt; filename)&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;string&lt;/span&gt; folder = &lt;span style="color: #2b91af;"&gt;ConfigurationManager&lt;/span&gt;.AppSettings[&lt;span style="color: #a31515;"&gt;"MyFolder"&lt;/span&gt;];&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;return&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;Path&lt;/span&gt;.Combine(folder, filename);&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=SystemIOPathCombine"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=SystemIOPathCombine" border="0"/&gt;&lt;/a&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=6r_TWOgmsyo:kuwuR_bMyCA:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=6r_TWOgmsyo:kuwuR_bMyCA:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=6r_TWOgmsyo:kuwuR_bMyCA:XQ266DUsA9M"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=XQ266DUsA9M" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=6r_TWOgmsyo:kuwuR_bMyCA:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=6r_TWOgmsyo:kuwuR_bMyCA:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=6r_TWOgmsyo:kuwuR_bMyCA:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=6r_TWOgmsyo:kuwuR_bMyCA:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=6r_TWOgmsyo:kuwuR_bMyCA:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=6r_TWOgmsyo:kuwuR_bMyCA:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=6r_TWOgmsyo:kuwuR_bMyCA:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotNetTipOfTheDay/~4/6r_TWOgmsyo" height="1" width="1"/&gt;</description>
      <guid isPermaLink="false">http://dotnettipoftheday.org/tips/SystemIOPathCombine.aspx</guid>
      <pubDate>Mon, 03 Sep 2007 00:00:00 GMT</pubDate>
      <wfw:commentRss>http://dotnettipoftheday.org/tips/CommentsRss.aspx?tipid=SystemIOPathCombine</wfw:commentRss>
    <link>http://feedproxy.google.com/~r/dotNetTipOfTheDay/~3/6r_TWOgmsyo/SystemIOPathCombine.aspx</link><feedburner:origLink>http://dotnettipoftheday.org/tips/SystemIOPathCombine.aspx</feedburner:origLink></item>
    <item>
      <title>Always check Page.IsValid in your button's EventHandler</title>
      <description>&lt;p&gt;Just because you are using ASP.NET validation controls, do not assume the page could not be submitted with invalid data.&lt;/p&gt;

&lt;p&gt;Also, just because you hide a control, do not assume buttons/textboxes/etc on it are not submit-able. It is perfectly fine to hide a control that a user should not access, but with very little code (or using a third party tool) users can easily make an HttpPost with any data they choose.&lt;/p&gt;&lt;br /&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=always_check_Page_IsValid"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=always_check_Page_IsValid" border="0"/&gt;&lt;/a&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=23SaHGaNkkk:IsjKAqoFzmY:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=23SaHGaNkkk:IsjKAqoFzmY:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=23SaHGaNkkk:IsjKAqoFzmY:XQ266DUsA9M"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=XQ266DUsA9M" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=23SaHGaNkkk:IsjKAqoFzmY:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=23SaHGaNkkk:IsjKAqoFzmY:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=23SaHGaNkkk:IsjKAqoFzmY:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=23SaHGaNkkk:IsjKAqoFzmY:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=23SaHGaNkkk:IsjKAqoFzmY:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=23SaHGaNkkk:IsjKAqoFzmY:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=23SaHGaNkkk:IsjKAqoFzmY:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotNetTipOfTheDay/~4/23SaHGaNkkk" height="1" width="1"/&gt;</description>
      <guid isPermaLink="false">http://dotnettipoftheday.org/tips/always_check_Page_IsValid.aspx</guid>
      <pubDate>Fri, 31 Aug 2007 23:23:00 GMT</pubDate>
      <wfw:commentRss>http://dotnettipoftheday.org/tips/CommentsRss.aspx?tipid=always_check_Page_IsValid</wfw:commentRss>
    <link>http://feedproxy.google.com/~r/dotNetTipOfTheDay/~3/23SaHGaNkkk/always_check_Page_IsValid.aspx</link><feedburner:origLink>http://dotnettipoftheday.org/tips/always_check_Page_IsValid.aspx</feedburner:origLink></item>
    <item>
      <title>Use DebuggerStepThrough attribute to save time when debugging</title>
      <description>&lt;p&gt;When debugging code, one of the annoying things is to step into an one-line method or property. Assume that you have the following property:&lt;p&gt;

&lt;div style="font-family: Courier New; font-size: 10pt; color: black; background: white;"&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;private&lt;/span&gt; &lt;span style="color: blue;"&gt;string&lt;/span&gt; word;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;string&lt;/span&gt; Word&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;get&lt;/span&gt; { &lt;span style="color: blue;"&gt;return&lt;/span&gt; word; }&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;set&lt;/span&gt; { word = &lt;span style="color: blue;"&gt;value&lt;/span&gt;; }&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;And you have a code that uses that property when calling a method:&lt;/p&gt;

&lt;div style="font-family: Courier New; font-size: 10pt; color: black; background: white;"&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DoSomething(obj.Word);&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;When you debug that line, and hit F11 to step into the method, you'll step into the get section of the property, and only then move on to the method.&lt;/p&gt;

&lt;p&gt;By placing &lt;a href="http://msdn2.microsoft.com/en-us/library/system.diagnostics.debuggerstepthroughattribute.aspx"&gt;System.Diagnostics.DebuggerStepThrough&lt;/a&gt; attribute above get and set sections of the property you instruct the debugger to step through that property and not into it:&lt;/p&gt;

&lt;div style="font-family: Courier New; font-size: 10pt; color: black; background: white;"&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;string&lt;/span&gt; Word&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; [System.Diagnostics.&lt;span style="color: #2b91af;"&gt;DebuggerStepThrough&lt;/span&gt;]&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;get&lt;/span&gt; { &lt;span style="color: blue;"&gt;return&lt;/span&gt; word; }&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; [System.Diagnostics.&lt;span style="color: #2b91af;"&gt;DebuggerStepThrough&lt;/span&gt;]&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;set&lt;/span&gt; { word = &lt;span style="color: blue;"&gt;value&lt;/span&gt;; }&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;This instruction will cause the debugger not to step into method (property) as normal, but you can always place a breakpoint in that method and stop there.&lt;/p&gt;&lt;br /&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=DebuggerStepThroughAttribute"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=DebuggerStepThroughAttribute" border="0"/&gt;&lt;/a&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=syx_S_MnU9o:pjdJ-xq-NXY:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=syx_S_MnU9o:pjdJ-xq-NXY:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=syx_S_MnU9o:pjdJ-xq-NXY:XQ266DUsA9M"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=XQ266DUsA9M" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=syx_S_MnU9o:pjdJ-xq-NXY:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=syx_S_MnU9o:pjdJ-xq-NXY:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=syx_S_MnU9o:pjdJ-xq-NXY:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=syx_S_MnU9o:pjdJ-xq-NXY:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=syx_S_MnU9o:pjdJ-xq-NXY:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=syx_S_MnU9o:pjdJ-xq-NXY:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=syx_S_MnU9o:pjdJ-xq-NXY:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotNetTipOfTheDay/~4/syx_S_MnU9o" height="1" width="1"/&gt;</description>
      <guid isPermaLink="false">http://dotnettipoftheday.org/tips/DebuggerStepThroughAttribute.aspx</guid>
      <pubDate>Thu, 30 Aug 2007 00:00:00 GMT</pubDate>
      <wfw:commentRss>http://dotnettipoftheday.org/tips/CommentsRss.aspx?tipid=DebuggerStepThroughAttribute</wfw:commentRss>
    <link>http://feedproxy.google.com/~r/dotNetTipOfTheDay/~3/syx_S_MnU9o/DebuggerStepThroughAttribute.aspx</link><feedburner:origLink>http://dotnettipoftheday.org/tips/DebuggerStepThroughAttribute.aspx</feedburner:origLink></item>
    <item>
      <title>Speed up string comparison</title>
      <description>&lt;p&gt;The &lt;a href="http://msdn2.microsoft.com/en-us/library/system.string.compare.aspx"&gt;Compare&lt;/a&gt; method compares strings in a local-aware fashion, so it has to convert the Unicode code of each character into a numeric value that reflects its position in the current culture's alphabet. For example, the Compare method considers the "b" lowercase character to come immediately after the "A" uppercase char and before the "B" uppercase char, even though the "A" and "B" characters are contiguous in the Unicode character set. This conversion activity takes time and consume CPU cycles, so you'll find that VB.NET is less efficient than VB6 at comparing strings. Using the = operator and other comparison operators doesn't help at all, because they map to the Compare method behind the scenes, so these operators suffer from the same performance loss.&lt;/p&gt;

&lt;p&gt;If you are only interested in checking whether two strings contain the same characters (in a case-sensitive comparison), you can speed up your code by using the &lt;a href="http://msdn2.microsoft.com/en-us/library/system.string.compareordinal.aspx"&gt;CompareOrdinal&lt;/a&gt; shared method. This method is 3-4 times faster than the Compare method (or the = operator) because it just scans the two strings and compare the Unicode numeric code of each character.&lt;/p&gt;
&lt;br /&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=faster_string_comparison"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=faster_string_comparison" border="0"/&gt;&lt;/a&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=S2YY5i-gxsg:G7XFt5S-57k:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=S2YY5i-gxsg:G7XFt5S-57k:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=S2YY5i-gxsg:G7XFt5S-57k:XQ266DUsA9M"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=XQ266DUsA9M" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=S2YY5i-gxsg:G7XFt5S-57k:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=S2YY5i-gxsg:G7XFt5S-57k:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=S2YY5i-gxsg:G7XFt5S-57k:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=S2YY5i-gxsg:G7XFt5S-57k:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=S2YY5i-gxsg:G7XFt5S-57k:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=S2YY5i-gxsg:G7XFt5S-57k:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=S2YY5i-gxsg:G7XFt5S-57k:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotNetTipOfTheDay/~4/S2YY5i-gxsg" height="1" width="1"/&gt;</description>
      <guid isPermaLink="false">http://dotnettipoftheday.org/tips/faster_string_comparison.aspx</guid>
      <pubDate>Tue, 28 Aug 2007 12:23:00 GMT</pubDate>
      <wfw:commentRss>http://dotnettipoftheday.org/tips/CommentsRss.aspx?tipid=faster_string_comparison</wfw:commentRss>
    <link>http://feedproxy.google.com/~r/dotNetTipOfTheDay/~3/S2YY5i-gxsg/faster_string_comparison.aspx</link><feedburner:origLink>http://dotnettipoftheday.org/tips/faster_string_comparison.aspx</feedburner:origLink></item>
    <item>
      <title>Quickly move to matching brace in Visual Studio</title>
      <description>&lt;p&gt;Just press &lt;code style="color:Teal"&gt;Ctrl+]&lt;/code&gt; and VS.NET will take you to the matching brace. It also will take you to the matching comment, region or quote depending on what is at the cursor now.&lt;/p&gt;&lt;br /&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=move_to_matching_brace"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=move_to_matching_brace" border="0"/&gt;&lt;/a&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=645CDQXNPk0:wMlqI4dQG70:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=645CDQXNPk0:wMlqI4dQG70:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=645CDQXNPk0:wMlqI4dQG70:XQ266DUsA9M"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=XQ266DUsA9M" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=645CDQXNPk0:wMlqI4dQG70:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=645CDQXNPk0:wMlqI4dQG70:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=645CDQXNPk0:wMlqI4dQG70:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=645CDQXNPk0:wMlqI4dQG70:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=645CDQXNPk0:wMlqI4dQG70:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=645CDQXNPk0:wMlqI4dQG70:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=645CDQXNPk0:wMlqI4dQG70:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotNetTipOfTheDay/~4/645CDQXNPk0" height="1" width="1"/&gt;</description>
      <guid isPermaLink="false">http://dotnettipoftheday.org/tips/move_to_matching_brace.aspx</guid>
      <pubDate>Thu, 23 Aug 2007 22:50:00 GMT</pubDate>
      <wfw:commentRss>http://dotnettipoftheday.org/tips/CommentsRss.aspx?tipid=move_to_matching_brace</wfw:commentRss>
    <link>http://feedproxy.google.com/~r/dotNetTipOfTheDay/~3/645CDQXNPk0/move_to_matching_brace.aspx</link><feedburner:origLink>http://dotnettipoftheday.org/tips/move_to_matching_brace.aspx</feedburner:origLink></item>
    <item>
      <title>Linking a file in Visual Studio.NET</title>
      <description>&lt;p&gt;If in VS.NET you add to the current project an existing file that's located outside the current project's directory, the file is first copied in the project's directory, and then it's added to the project. However, you may want to share the same source file among multiple projects. As a trivially simple example, perhaps you get tired of specifying the same AssemblyCompany and AssemblyCopyright strings, over and over again, in all your projects?  Wouldn't it be nice to have a little two-line C# file tucked away somewhere, and include it by reference in all your projects?&lt;/p&gt;

&lt;div style="font-family: Consolas; font-size: 10pt; color: black; background: white;"&gt;
&lt;p style="margin: 0px;"&gt;[assembly: System.Reflection.&lt;span style="color: #2b91af;"&gt;AssemblyCompany&lt;/span&gt;(&lt;span style="color: #a31515;"&gt;".NET Tip of The Day.org"&lt;/span&gt;)]&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;[assembly: System.Reflection.&lt;span style="color: #2b91af;"&gt;AssemblyCopyright&lt;/span&gt;(&lt;span style="color: #a31515;"&gt;"&amp;#169; 2007 All rights reserved."&lt;/span&gt;)]&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;To add a shared file, open the dialog to select an existing file with the Project | Add Existing Item… menu item and select the file you want to include. Then, instead of clicking the Open button, click the arrow on the left of that button, and click Link File from the list that drops down. This way you link to the original file, not to a local copy of it.&lt;/p&gt;
&lt;br /&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=linking_file_in_visual_studio"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=linking_file_in_visual_studio" border="0"/&gt;&lt;/a&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=xQjgpE0t-So:5iH8-xeGBPo:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=xQjgpE0t-So:5iH8-xeGBPo:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=xQjgpE0t-So:5iH8-xeGBPo:XQ266DUsA9M"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=XQ266DUsA9M" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=xQjgpE0t-So:5iH8-xeGBPo:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=xQjgpE0t-So:5iH8-xeGBPo:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=xQjgpE0t-So:5iH8-xeGBPo:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=xQjgpE0t-So:5iH8-xeGBPo:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=xQjgpE0t-So:5iH8-xeGBPo:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=xQjgpE0t-So:5iH8-xeGBPo:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=xQjgpE0t-So:5iH8-xeGBPo:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotNetTipOfTheDay/~4/xQjgpE0t-So" height="1" width="1"/&gt;</description>
      <guid isPermaLink="false">http://dotnettipoftheday.org/tips/linking_file_in_visual_studio.aspx</guid>
      <pubDate>Wed, 22 Aug 2007 20:22:00 GMT</pubDate>
      <wfw:commentRss>http://dotnettipoftheday.org/tips/CommentsRss.aspx?tipid=linking_file_in_visual_studio</wfw:commentRss>
    <link>http://feedproxy.google.com/~r/dotNetTipOfTheDay/~3/xQjgpE0t-So/linking_file_in_visual_studio.aspx</link><feedburner:origLink>http://dotnettipoftheday.org/tips/linking_file_in_visual_studio.aspx</feedburner:origLink></item>
    <item>
      <title>Don’t clear the stack trace when re-throwing an exception</title>
      <description>&lt;p&gt;Often, we need to put some exception handling on catch blocks (e.g., to rollback a transaction) and re-throw the exception. There are two ways of doing it. The wrong way:&lt;/p&gt;

&lt;div style="font-family: Consolas; font-size: 10pt; color: black; background: white;"&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;try&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: green;"&gt;// Some code that throws an exception&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;catch&lt;/span&gt; (&lt;span style="color: #2b91af;"&gt;Exception&lt;/span&gt; ex)&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: green;"&gt;// some code that handles the exception&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;throw&lt;/span&gt; ex;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Why is this wrong? Because, when you examine the stack trace, the point of the exception will be the line of the “&lt;code&gt;&lt;span style="color: blue;"&gt;throw&lt;/span&gt; ex;&lt;/code&gt;“, hiding the real error location. Instead of “&lt;code&gt;&lt;span style="color: blue;"&gt;throw&lt;/span&gt; ex;&lt;/code&gt;“, which will throw a new exception and clear the stack trace, simply use "&lt;code&gt;&lt;span style="color: blue;"&gt;throw&lt;/span&gt;;&lt;/code&gt;":&lt;/p&gt;

&lt;div style="font-family: Consolas; font-size: 10pt; color: black; background: white;"&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;try&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: green;"&gt;// Some code that throws an exception&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;catch&lt;/span&gt; (&lt;span style="color: #2b91af;"&gt;Exception&lt;/span&gt; ex)&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: green;"&gt;// some code that handles the exception&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;throw&lt;/span&gt;;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;If you don’t specify the exception, the throw statement will simply rethrow the very same exception the catch statement caught. This will keep your stack trace intact, but still allows you to put code in your catch blocks.&lt;/p&gt;&lt;br /&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=re-throwing_exceptions"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=re-throwing_exceptions" border="0"/&gt;&lt;/a&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=K1eUxIRtg7E:NXpa2wBXZD0:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=K1eUxIRtg7E:NXpa2wBXZD0:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=K1eUxIRtg7E:NXpa2wBXZD0:XQ266DUsA9M"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=XQ266DUsA9M" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=K1eUxIRtg7E:NXpa2wBXZD0:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=K1eUxIRtg7E:NXpa2wBXZD0:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=K1eUxIRtg7E:NXpa2wBXZD0:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=K1eUxIRtg7E:NXpa2wBXZD0:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=K1eUxIRtg7E:NXpa2wBXZD0:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=K1eUxIRtg7E:NXpa2wBXZD0:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=K1eUxIRtg7E:NXpa2wBXZD0:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotNetTipOfTheDay/~4/K1eUxIRtg7E" height="1" width="1"/&gt;</description>
      <guid isPermaLink="false">http://dotnettipoftheday.org/tips/re-throwing_exceptions.aspx</guid>
      <pubDate>Tue, 21 Aug 2007 23:15:00 GMT</pubDate>
      <wfw:commentRss>http://dotnettipoftheday.org/tips/CommentsRss.aspx?tipid=re-throwing_exceptions</wfw:commentRss>
    <link>http://feedproxy.google.com/~r/dotNetTipOfTheDay/~3/K1eUxIRtg7E/re-throwing_exceptions.aspx</link><feedburner:origLink>http://dotnettipoftheday.org/tips/re-throwing_exceptions.aspx</feedburner:origLink></item>
    <item>
      <title>Exceptions cause performance to suffer significantly</title>
      <description>&lt;p&gt;Do not rely on exceptions in your code and write code that avoids exceptions. Since exceptions cause performance to suffer significantly, you should never use them as a way to control normal program flow. If it is possible to detect in code a condition that would cause an exception, do so. Do not catch the exception itself before you handle that condition. Do not use exceptions to control logic. A database connection that fails to open is an exception but a user who mistypes his password is simply a condition that needs to be handled. Common scenarios include checking for null, assigning a value to a String that will be parsed into a numeric value, or checking for specific values before applying math operations.&lt;/p&gt;
&lt;div style="font-family: Courier New; font-size: 10pt; color: black; background: white;"&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: green;"&gt;//Unnecessary use of exception&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;try&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;{&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; value = 100/number;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;}&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;catch&lt;/span&gt;(&lt;span style="color: #2b91af;"&gt;Exception&lt;/span&gt; ex)&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;{&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; value = 0;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;}&lt;/p&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=throw_exceptions_performance_degradation"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=throw_exceptions_performance_degradation" border="0"/&gt;&lt;/a&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=c4PuAuEqQc8:8EVYwLZqvZE:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=c4PuAuEqQc8:8EVYwLZqvZE:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=c4PuAuEqQc8:8EVYwLZqvZE:XQ266DUsA9M"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=XQ266DUsA9M" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=c4PuAuEqQc8:8EVYwLZqvZE:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=c4PuAuEqQc8:8EVYwLZqvZE:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=c4PuAuEqQc8:8EVYwLZqvZE:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=c4PuAuEqQc8:8EVYwLZqvZE:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=c4PuAuEqQc8:8EVYwLZqvZE:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=c4PuAuEqQc8:8EVYwLZqvZE:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=c4PuAuEqQc8:8EVYwLZqvZE:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotNetTipOfTheDay/~4/c4PuAuEqQc8" height="1" width="1"/&gt;</description>
      <guid isPermaLink="false">http://dotnettipoftheday.org/tips/throw_exceptions_performance_degradation.aspx</guid>
      <pubDate>Mon, 20 Aug 2007 00:00:00 GMT</pubDate>
      <wfw:commentRss>http://dotnettipoftheday.org/tips/CommentsRss.aspx?tipid=throw_exceptions_performance_degradation</wfw:commentRss>
    <link>http://feedproxy.google.com/~r/dotNetTipOfTheDay/~3/c4PuAuEqQc8/throw_exceptions_performance_degradation.aspx</link><feedburner:origLink>http://dotnettipoftheday.org/tips/throw_exceptions_performance_degradation.aspx</feedburner:origLink></item>
    <item>
      <title>Quickly locate where the exceptions are thrown</title>
      <description>&lt;p&gt;How many times has this happened to you? You're working on code that's not quite functioning correctly. You suspect there's an exception being thrown somewhere, but it's being caught and ignored. Maybe this was intentional, or maybe it was poorly written code. Either way, you need to locate the problem.&lt;/p&gt;
&lt;p&gt;To do this, open the Exceptions dialog, either through the menu (Debug &gt; Exceptions) or the keyboard shortcut (&lt;code style="color:Teal"&gt;Ctrl+D, E&lt;/code&gt;).&lt;/p&gt;
&lt;img src="http://dotnettipoftheday.org/resources/debug_exceptions.png" alt="Debug-&amp;gt;Exceptions... Dialog" /&gt;
&lt;p&gt;Under the Thrown column, check the box next to the Common Language Runtime Exceptions. Now, when an exception is thrown, VS immediately breaks at the offending line of code.&lt;/p&gt;&lt;br /&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=break_when_exception_thrown"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=break_when_exception_thrown" border="0"/&gt;&lt;/a&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=OEp1aIwQVfU:RjGioVUV9pU:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=OEp1aIwQVfU:RjGioVUV9pU:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=OEp1aIwQVfU:RjGioVUV9pU:XQ266DUsA9M"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=XQ266DUsA9M" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=OEp1aIwQVfU:RjGioVUV9pU:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=OEp1aIwQVfU:RjGioVUV9pU:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=OEp1aIwQVfU:RjGioVUV9pU:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=OEp1aIwQVfU:RjGioVUV9pU:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=OEp1aIwQVfU:RjGioVUV9pU:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=OEp1aIwQVfU:RjGioVUV9pU:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=OEp1aIwQVfU:RjGioVUV9pU:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotNetTipOfTheDay/~4/OEp1aIwQVfU" height="1" width="1"/&gt;</description>
      <guid isPermaLink="false">http://dotnettipoftheday.org/tips/break_when_exception_thrown.aspx</guid>
      <pubDate>Fri, 17 Aug 2007 00:00:00 GMT</pubDate>
      <wfw:commentRss>http://dotnettipoftheday.org/tips/CommentsRss.aspx?tipid=break_when_exception_thrown</wfw:commentRss>
    <link>http://feedproxy.google.com/~r/dotNetTipOfTheDay/~3/OEp1aIwQVfU/break_when_exception_thrown.aspx</link><feedburner:origLink>http://dotnettipoftheday.org/tips/break_when_exception_thrown.aspx</feedburner:origLink></item>
    <item>
      <title>Visual Studio Full Screen Mode</title>
      <description>&lt;p&gt;You can quickly toggle into Full Screen mode by pressing &lt;code style="color:Teal"&gt;Shift+Alt+Enter&lt;/code&gt;.&lt;/p&gt;&lt;br /&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=visual_studio_full_screen_mode"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=visual_studio_full_screen_mode" border="0"/&gt;&lt;/a&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=g3Bn8NfkFr4:47r_gUNi8oU:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=g3Bn8NfkFr4:47r_gUNi8oU:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=g3Bn8NfkFr4:47r_gUNi8oU:XQ266DUsA9M"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=XQ266DUsA9M" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=g3Bn8NfkFr4:47r_gUNi8oU:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=g3Bn8NfkFr4:47r_gUNi8oU:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=g3Bn8NfkFr4:47r_gUNi8oU:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=g3Bn8NfkFr4:47r_gUNi8oU:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=g3Bn8NfkFr4:47r_gUNi8oU:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=g3Bn8NfkFr4:47r_gUNi8oU:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=g3Bn8NfkFr4:47r_gUNi8oU:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotNetTipOfTheDay/~4/g3Bn8NfkFr4" height="1" width="1"/&gt;</description>
      <guid isPermaLink="false">http://dotnettipoftheday.org/tips/visual_studio_full_screen_mode.aspx</guid>
      <pubDate>Thu, 16 Aug 2007 00:00:00 GMT</pubDate>
      <wfw:commentRss>http://dotnettipoftheday.org/tips/CommentsRss.aspx?tipid=visual_studio_full_screen_mode</wfw:commentRss>
    <link>http://feedproxy.google.com/~r/dotNetTipOfTheDay/~3/g3Bn8NfkFr4/visual_studio_full_screen_mode.aspx</link><feedburner:origLink>http://dotnettipoftheday.org/tips/visual_studio_full_screen_mode.aspx</feedburner:origLink></item>
    <item>
      <title>Incremental search in Visual Studio</title>
      <description>&lt;ol&gt;
&lt;li&gt;Press &lt;code style="color:Teal"&gt;Ctrl+I&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Start typing the text you are searching for.  Note: you'll see the cursor jump to the first match, highlighting the current search string.&lt;/li&gt;
&lt;li&gt;Press &lt;code style="color:Teal"&gt;Ctrl+I&lt;/code&gt; again to jump to the next occurrence of the search string.&lt;/li&gt;
&lt;li&gt;To stop search, press &lt;code style="color:Teal"&gt;Esc&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;
&lt;p style="padding-left:10pt"&gt;Advanced tip: Press &lt;code style="color:Teal"&gt;Ctrl+Shift+I&lt;/code&gt; to search backwards.&lt;/p&gt;&lt;br /&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=incremental_search_in_visual_studio"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=incremental_search_in_visual_studio" border="0"/&gt;&lt;/a&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=0Bj29aq-R68:70KVozIfMEY:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=0Bj29aq-R68:70KVozIfMEY:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=0Bj29aq-R68:70KVozIfMEY:XQ266DUsA9M"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=XQ266DUsA9M" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=0Bj29aq-R68:70KVozIfMEY:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=0Bj29aq-R68:70KVozIfMEY:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=0Bj29aq-R68:70KVozIfMEY:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=0Bj29aq-R68:70KVozIfMEY:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=0Bj29aq-R68:70KVozIfMEY:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=0Bj29aq-R68:70KVozIfMEY:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=0Bj29aq-R68:70KVozIfMEY:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotNetTipOfTheDay/~4/0Bj29aq-R68" height="1" width="1"/&gt;</description>
      <guid isPermaLink="false">http://dotnettipoftheday.org/tips/incremental_search_in_visual_studio.aspx</guid>
      <pubDate>Wed, 15 Aug 2007 00:00:00 GMT</pubDate>
      <wfw:commentRss>http://dotnettipoftheday.org/tips/CommentsRss.aspx?tipid=incremental_search_in_visual_studio</wfw:commentRss>
    <link>http://feedproxy.google.com/~r/dotNetTipOfTheDay/~3/0Bj29aq-R68/incremental_search_in_visual_studio.aspx</link><feedburner:origLink>http://dotnettipoftheday.org/tips/incremental_search_in_visual_studio.aspx</feedburner:origLink></item>
    <item>
      <title>Auto-complete the word in Visual Studio 2005</title>
      <description>&lt;p&gt;Type the first few characters of a control/variable/type name and hit &lt;code style="color:Teal"&gt;Ctrl+Space&lt;/code&gt; or &lt;code style="color:Teal"&gt;Alt+RightArrow&lt;/code&gt; to auto-complete the word. If there is more than one possibility Intellisense suggestions will pop up a window with available options.&lt;/p&gt;&lt;br /&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=auto-complete_in_visual_studio"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=auto-complete_in_visual_studio" border="0"/&gt;&lt;/a&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=L_lH4ob1eII:-b3ULOoIQK4:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=L_lH4ob1eII:-b3ULOoIQK4:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=L_lH4ob1eII:-b3ULOoIQK4:XQ266DUsA9M"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=XQ266DUsA9M" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=L_lH4ob1eII:-b3ULOoIQK4:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=L_lH4ob1eII:-b3ULOoIQK4:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=L_lH4ob1eII:-b3ULOoIQK4:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=L_lH4ob1eII:-b3ULOoIQK4:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=L_lH4ob1eII:-b3ULOoIQK4:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=L_lH4ob1eII:-b3ULOoIQK4:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=L_lH4ob1eII:-b3ULOoIQK4:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotNetTipOfTheDay/~4/L_lH4ob1eII" height="1" width="1"/&gt;</description>
      <guid isPermaLink="false">http://dotnettipoftheday.org/tips/auto-complete_in_visual_studio.aspx</guid>
      <pubDate>Fri, 10 Aug 2007 00:00:00 GMT</pubDate>
      <wfw:commentRss>http://dotnettipoftheday.org/tips/CommentsRss.aspx?tipid=auto-complete_in_visual_studio</wfw:commentRss>
    <link>http://feedproxy.google.com/~r/dotNetTipOfTheDay/~3/L_lH4ob1eII/auto-complete_in_visual_studio.aspx</link><feedburner:origLink>http://dotnettipoftheday.org/tips/auto-complete_in_visual_studio.aspx</feedburner:origLink></item>
    <item>
      <title>Always set the &amp;quot;applicationName&amp;quot; property when configuring Membership and other Providers</title>
      <description>&lt;p&gt;Users created with the membership API will be associated with &lt;a href="http://msdn2.microsoft.com/en-us/library/whae3t94.aspx#attributesandElementsToggle"&gt;applicationName&lt;/a&gt; value specified in provider declaration in web.config file. This diagramm shows how user is associated with applicationName in database:&lt;/p&gt;
&lt;img src="http://dotnettipoftheday.org/resources/user_application.png" alt="Relations between aspnet_Users and aspnet_Applications" /&gt;

&lt;p&gt;When no applicationName attribute is configured, ASP.NET uses the application vroot path within the web-server to automatically calculate the applicationName to use when adding data to an ASP.NET Application Service database.&lt;/p&gt;

&lt;p&gt;Now let's assume you develop an ASP.NET 2.0 application locally using Membership, Roles or Profile features and you haven't specified applicationName attribute. You create several new users. Because applicationName property was not specified your users were associated with auto calculated value (something like "/WebSite1").&lt;/p&gt;

&lt;p&gt;This works fine when the application continues to run in the "/WebSite1" application virtual path. But if it is copied to another location or server with a different virtual path (for example: "/app1" or more commonly just "/"), then when the Membership APIs are used they will not "see" the users already in our database – since they will lookup membership data using a different application name and filter the users in the application_Users table accordingly. That is why you'll get a "Login attempt unsuccessful, please try again." message when you try to login.&lt;/p&gt;

&lt;p&gt;The best way to prevent this from ever happening is to always specify the "applicationName" attribute when declaring your providers.  One good default value to use is "/" – which is the root application name.  This is the value specified for the default provider that ships with ASP.NET 2.0 (which by default stores the application service data within the ASPNETDB.MDF file under /app_data), and is why if you don't override the provider settings it will work if you copy an app to another machine.&lt;/p&gt;

&lt;p&gt;&lt;br /&gt;&lt;br /&gt;P.S. The reason why the applicationName setting even exists in the first place is so that you can map multiple applications and sites to the same database.&lt;/p&gt;
&lt;br /&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=applicationName_attribute"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=applicationName_attribute" border="0"/&gt;&lt;/a&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=YGFGHHcdIGI:wMniizxS_a4:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=YGFGHHcdIGI:wMniizxS_a4:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=YGFGHHcdIGI:wMniizxS_a4:XQ266DUsA9M"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=XQ266DUsA9M" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=YGFGHHcdIGI:wMniizxS_a4:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=YGFGHHcdIGI:wMniizxS_a4:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=YGFGHHcdIGI:wMniizxS_a4:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=YGFGHHcdIGI:wMniizxS_a4:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=YGFGHHcdIGI:wMniizxS_a4:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=YGFGHHcdIGI:wMniizxS_a4:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=YGFGHHcdIGI:wMniizxS_a4:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotNetTipOfTheDay/~4/YGFGHHcdIGI" height="1" width="1"/&gt;</description>
      <guid isPermaLink="false">http://dotnettipoftheday.org/tips/applicationName_attribute.aspx</guid>
      <pubDate>Thu, 09 Aug 2007 00:00:00 GMT</pubDate>
      <wfw:commentRss>http://dotnettipoftheday.org/tips/CommentsRss.aspx?tipid=applicationName_attribute</wfw:commentRss>
    <link>http://feedproxy.google.com/~r/dotNetTipOfTheDay/~3/YGFGHHcdIGI/applicationName_attribute.aspx</link><feedburner:origLink>http://dotnettipoftheday.org/tips/applicationName_attribute.aspx</feedburner:origLink></item>
    <item>
      <title>Don't forget to &amp;lt;clear/&amp;gt; when adding providers</title>
      <description>&lt;p&gt;You want to configure ASP.NET 2.0 to store your Membership/Role Management/Profile data within a remote SQL database. You decide to register a new provider within your web.config file like below:&lt;/p&gt;
&lt;div style="font-family: Consolas; font-size: 10pt; color: black; background: white;"&gt;
	&lt;p style="margin:0px"&gt;&lt;span style="color:blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;membership&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
	&lt;p style="margin:0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;providers&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
	&lt;p style="margin:0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;add&lt;/span&gt;&lt;span style="color:red"&gt;&amp;nbsp;name&lt;/span&gt;&lt;span style="color:blue"&gt;="AspNetSqlMembershipProvider"&lt;/span&gt;&lt;/p&gt;
	&lt;p style="margin:0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:red"&gt;type&lt;/span&gt;&lt;span style="color:blue"&gt;="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"&lt;/span&gt;&lt;/p&gt;
	&lt;p style="margin:0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:red"&gt;connectionStringName&lt;/span&gt;&lt;span style="color:blue"&gt;="MyDatabase"&lt;/span&gt;&lt;/p&gt;
	&lt;p style="margin:0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:red"&gt;enablePasswordRetrieval&lt;/span&gt;&lt;span style="color:blue"&gt;="false"&lt;/span&gt;&lt;/p&gt;
	&lt;p style="margin:0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:red"&gt;enablePasswordReset&lt;/span&gt;&lt;span style="color:blue"&gt;="true"&lt;/span&gt;&lt;/p&gt;
	&lt;p style="margin:0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:red"&gt;requiresQuestionAndAnswer&lt;/span&gt;&lt;span style="color:blue"&gt;="true"&lt;/span&gt;&lt;/p&gt;
	&lt;p style="margin:0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:red"&gt;requiresUniqueEmail&lt;/span&gt;&lt;span style="color:blue"&gt;="false"&lt;/span&gt;&lt;/p&gt;
	&lt;p style="margin:0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:red"&gt;passwordFormat&lt;/span&gt;&lt;span style="color:blue"&gt;="Hashed"&lt;/span&gt;&lt;/p&gt;
	&lt;p style="margin:0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:red"&gt;maxInvalidPasswordAttempts&lt;/span&gt;&lt;span style="color:blue"&gt;="5"&lt;/span&gt;&lt;/p&gt;
	&lt;p style="margin:0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:red"&gt;minRequiredPasswordLength&lt;/span&gt;&lt;span style="color:blue"&gt;="7"&lt;/span&gt;&lt;/p&gt;
	&lt;p style="margin:0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:red"&gt;minRequiredNonalphanumericCharacters&lt;/span&gt;&lt;span style="color:blue"&gt;="1"&lt;/span&gt;&lt;/p&gt;
	&lt;p style="margin:0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:red"&gt;passwordAttemptWindow&lt;/span&gt;&lt;span style="color:blue"&gt;="10"&lt;/span&gt;&lt;/p&gt;
	&lt;p style="margin:0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:red"&gt;passwordStrengthRegularExpression&lt;/span&gt;&lt;span style="color:blue"&gt;=""&lt;/span&gt;&lt;/p&gt;
	&lt;p style="margin:0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:red"&gt;applicationName&lt;/span&gt;&lt;span style="color:blue"&gt;="/"&lt;/span&gt;&lt;/p&gt;
	&lt;p style="margin:0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue"&gt;/&amp;gt;&lt;/span&gt;&lt;/p&gt;
	&lt;p style="margin:0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;providers&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
	&lt;p style="margin:0px"&gt;&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;membership&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;When you run your application on a machine without SQL Express, though, you see some weird behavior.  You might get a SQL error like so:&lt;/p&gt;

&lt;p style="font-style:italic;padding-left:20px;padding-right:20px;"&gt;An error has occurred while establishing a connection to the server.  When connecting to SQL Server 2005, this failure may be caused by the fact that under the default settings SQL Server does not allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified)&lt;p&gt;

&lt;p&gt;The root cause of the above problem rests in how the new provider was registered within the web.config file. &lt;/p&gt;

&lt;p&gt;The &amp;lt;providers&amp;gt; section within the web.config file is implemented as a collection, and so it is possible to register multiple providers at the same time (this is useful when you want to have some users authenticated using one Membership store, and others authenticated using a separate Membership store).&lt;/p&gt;

&lt;p&gt;By default ASP.NET 2.0 registers a set of default SQL Express providers within the root web.config file on your machine that create a SQL Express database within your /app_data directory to store/manage membership/role/profile data when you first access it.  Because this is registered at the machine-wide level, all provider collections by default inherit this registration.  Unless you explictly &amp;lt;clear/&amp;gt; or override the inherited value, your application will have this default membership/role/profile provider registered.&lt;/p&gt;

&lt;p&gt;Because the above web.config file simply added a new provider -- and didn't clear or replace the default provider registration -- the above application now has two Membership providers configured.  When you do a Membership.CreateUser() call in your code, ASP.NET will attempt to create the user in both membership databases.  If you don't have SQL Express installed on your system, the create-user attempt will fail for this database - which leads to the errors and/or weird behavior above.&lt;/p&gt;

&lt;p&gt;To fix this problem add an explicit &amp;lt;clear/&amp;gt; directive before your &amp;lt;add/&amp;gt; statements within your web.config file:&lt;p&gt;
&lt;div style="font-family: Consolas; font-size: 10pt; color: black; background: white;"&gt;
	&lt;p style="margin:0px"&gt;&lt;span style="color:blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;membership&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
	&lt;p style="margin:0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;providers&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
	&lt;p style="margin:0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;clear&lt;/span&gt;&lt;span style="color:blue"&gt;/&amp;gt;&lt;/span&gt;&lt;/p&gt;
	&lt;p style="margin:0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:maroon"&gt;add&lt;/span&gt;&lt;span style="color:red"&gt;&amp;nbsp;name&lt;/span&gt;&lt;span style="color:blue"&gt;="AspNetSqlMembershipProvider"&lt;/span&gt;&lt;/p&gt;
	&lt;p style="margin:0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:red"&gt;type&lt;/span&gt;&lt;span style="color:blue"&gt;="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"&lt;/span&gt;&lt;/p&gt;
	&lt;p style="margin:0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:red"&gt;connectionStringName&lt;/span&gt;&lt;span style="color:blue"&gt;="MyDatabase"&lt;/span&gt;&lt;/p&gt;
	&lt;p style="margin:0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:red"&gt;enablePasswordRetrieval&lt;/span&gt;&lt;span style="color:blue"&gt;="false"&lt;/span&gt;&lt;/p&gt;
	&lt;p style="margin:0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:red"&gt;enablePasswordReset&lt;/span&gt;&lt;span style="color:blue"&gt;="true"&lt;/span&gt;&lt;/p&gt;
	&lt;p style="margin:0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:red"&gt;requiresQuestionAndAnswer&lt;/span&gt;&lt;span style="color:blue"&gt;="true"&lt;/span&gt;&lt;/p&gt;
	&lt;p style="margin:0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:red"&gt;requiresUniqueEmail&lt;/span&gt;&lt;span style="color:blue"&gt;="false"&lt;/span&gt;&lt;/p&gt;
	&lt;p style="margin:0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:red"&gt;passwordFormat&lt;/span&gt;&lt;span style="color:blue"&gt;="Hashed"&lt;/span&gt;&lt;/p&gt;
	&lt;p style="margin:0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:red"&gt;maxInvalidPasswordAttempts&lt;/span&gt;&lt;span style="color:blue"&gt;="5"&lt;/span&gt;&lt;/p&gt;
	&lt;p style="margin:0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:red"&gt;minRequiredPasswordLength&lt;/span&gt;&lt;span style="color:blue"&gt;="7"&lt;/span&gt;&lt;/p&gt;
	&lt;p style="margin:0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:red"&gt;minRequiredNonalphanumericCharacters&lt;/span&gt;&lt;span style="color:blue"&gt;="1"&lt;/span&gt;&lt;/p&gt;
	&lt;p style="margin:0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:red"&gt;passwordAttemptWindow&lt;/span&gt;&lt;span style="color:blue"&gt;="10"&lt;/span&gt;&lt;/p&gt;
	&lt;p style="margin:0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:red"&gt;passwordStrengthRegularExpression&lt;/span&gt;&lt;span style="color:blue"&gt;=""&lt;/span&gt;&lt;/p&gt;
	&lt;p style="margin:0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:red"&gt;applicationName&lt;/span&gt;&lt;span style="color:blue"&gt;="/"&lt;/span&gt;&lt;/p&gt;
	&lt;p style="margin:0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue"&gt;/&amp;gt;&lt;/span&gt;&lt;/p&gt;
	&lt;p style="margin:0px"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;providers&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
	&lt;p style="margin:0px"&gt;&lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:maroon"&gt;membership&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Note that you must do this for each provider declaration that you register.  So if you are adding providers for &amp;lt;roles&amp;gt; and &amp;lt;profile&amp;gt;, make sure you add the &amp;lt;clear/&amp;gt; directive in their providers section as well.&lt;/p&gt;
&lt;br /&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=clear_when_adding_providers"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=clear_when_adding_providers" border="0"/&gt;&lt;/a&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=bhVkOClv-FQ:gghust3iaII:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=bhVkOClv-FQ:gghust3iaII:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=bhVkOClv-FQ:gghust3iaII:XQ266DUsA9M"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=XQ266DUsA9M" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=bhVkOClv-FQ:gghust3iaII:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=bhVkOClv-FQ:gghust3iaII:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=bhVkOClv-FQ:gghust3iaII:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=bhVkOClv-FQ:gghust3iaII:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=bhVkOClv-FQ:gghust3iaII:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=bhVkOClv-FQ:gghust3iaII:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=bhVkOClv-FQ:gghust3iaII:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotNetTipOfTheDay/~4/bhVkOClv-FQ" height="1" width="1"/&gt;</description>
      <guid isPermaLink="false">http://dotnettipoftheday.org/tips/clear_when_adding_providers.aspx</guid>
      <pubDate>Wed, 08 Aug 2007 00:00:00 GMT</pubDate>
      <wfw:commentRss>http://dotnettipoftheday.org/tips/CommentsRss.aspx?tipid=clear_when_adding_providers</wfw:commentRss>
    <link>http://feedproxy.google.com/~r/dotNetTipOfTheDay/~3/bhVkOClv-FQ/clear_when_adding_providers.aspx</link><feedburner:origLink>http://dotnettipoftheday.org/tips/clear_when_adding_providers.aspx</feedburner:origLink></item>
    <item>
      <title>How to perform DateTime calculations in a right way</title>
      <description>&lt;p&gt;When coding, be careful if you need to perform DateTime calculations (add/subtract) on values representing time zones that practice daylight savings time. Unexpected calculation errors can result. Instead, convert the local time value to universal time, perform the calculation, and convert back to achieve maximum accuracy.&lt;/p&gt;
&lt;div style="font-family: Consolas; font-size: 10pt; color: black; background: white;"&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #2b91af;"&gt;DateTime&lt;/span&gt; d;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; d = &lt;span style="color: #2b91af;"&gt;DateTime&lt;/span&gt;.Parse(&lt;span style="color: #a31515;"&gt;"Oct 26, 2003 12:00:00 AM"&lt;/span&gt;);&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: green;"&gt;//date assignment&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; d = d.ToUniversalTime().AddHours(3.0).ToLocalTime();&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: green;"&gt;//' - displays 10/26/2003 02:00:00 AM &amp;#8211; Correct!&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #2b91af;"&gt;MessageBox&lt;/span&gt;.Show(d.ToString());&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Working with DateTime structs seems to be simple, but it's not. Make sure you are aware of pitfalls discribed in the article &lt;a href="http://msdn2.microsoft.com/en-us/library/ms973825.aspx#datetime_topic9"&gt;Coding Best Practices Using DateTime in the .NET Framework&lt;/a&gt;.&lt;/p&gt;&lt;br /&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=DateTime_calculations"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=DateTime_calculations" border="0"/&gt;&lt;/a&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=9NIfffohTT0:SSv_9l8157A:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=9NIfffohTT0:SSv_9l8157A:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=9NIfffohTT0:SSv_9l8157A:XQ266DUsA9M"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=XQ266DUsA9M" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=9NIfffohTT0:SSv_9l8157A:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=9NIfffohTT0:SSv_9l8157A:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=9NIfffohTT0:SSv_9l8157A:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=9NIfffohTT0:SSv_9l8157A:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=9NIfffohTT0:SSv_9l8157A:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=9NIfffohTT0:SSv_9l8157A:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=9NIfffohTT0:SSv_9l8157A:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotNetTipOfTheDay/~4/9NIfffohTT0" height="1" width="1"/&gt;</description>
      <guid isPermaLink="false">http://dotnettipoftheday.org/tips/DateTime_calculations.aspx</guid>
      <pubDate>Tue, 07 Aug 2007 00:00:00 GMT</pubDate>
      <wfw:commentRss>http://dotnettipoftheday.org/tips/CommentsRss.aspx?tipid=DateTime_calculations</wfw:commentRss>
    <link>http://feedproxy.google.com/~r/dotNetTipOfTheDay/~3/9NIfffohTT0/DateTime_calculations.aspx</link><feedburner:origLink>http://dotnettipoftheday.org/tips/DateTime_calculations.aspx</feedburner:origLink></item>
    <item>
      <title>How to maintain the position of the scrollbar on postbacks</title>
      <description>&lt;p&gt;In ASP.NET 1.1 it was a pain to maintain the position of the scrollbar when doing a postback operation.  This was especially true when you had a grid on the page and went to edit a specific row.  Instead of staying on the desired row, the page would reload and you'd be placed back at the top and have to scroll down.  In ASP.NET 2.0 you can simply add the MaintainScrollPostionOnPostBack attribute to the Page directive:&lt;/p&gt;
&lt;div style="font-family: Courier New; font-size: 10pt; color: black; background: white;"&gt;
	&lt;p style="margin: 0px;"&gt;&lt;span style="background-color:yellow"&gt;&amp;lt;%&lt;/span&gt; &lt;span style="color:#a31515"&gt;Page&lt;/span&gt; &lt;span style="color:Red"&gt;Language&lt;/span&gt;&lt;span style="color:Blue"&gt;="C#"&lt;/span&gt; ... &lt;span style="color:red"&gt;MaintainScrollPositionOnPostback&lt;/span&gt;&lt;span style="color:blue"&gt;="true"&lt;/span&gt; &lt;span style="background-color:yellow"&gt;%&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=maintain_scroll_position"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=maintain_scroll_position" border="0"/&gt;&lt;/a&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=WMOfJboMhqA:Plcfmb6t7k0:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=WMOfJboMhqA:Plcfmb6t7k0:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=WMOfJboMhqA:Plcfmb6t7k0:XQ266DUsA9M"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=XQ266DUsA9M" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=WMOfJboMhqA:Plcfmb6t7k0:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=WMOfJboMhqA:Plcfmb6t7k0:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=WMOfJboMhqA:Plcfmb6t7k0:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=WMOfJboMhqA:Plcfmb6t7k0:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=WMOfJboMhqA:Plcfmb6t7k0:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=WMOfJboMhqA:Plcfmb6t7k0:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=WMOfJboMhqA:Plcfmb6t7k0:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotNetTipOfTheDay/~4/WMOfJboMhqA" height="1" width="1"/&gt;</description>
      <guid isPermaLink="false">http://dotnettipoftheday.org/tips/maintain_scroll_position.aspx</guid>
      <pubDate>Mon, 06 Aug 2007 00:00:00 GMT</pubDate>
      <wfw:commentRss>http://dotnettipoftheday.org/tips/CommentsRss.aspx?tipid=maintain_scroll_position</wfw:commentRss>
    <link>http://feedproxy.google.com/~r/dotNetTipOfTheDay/~3/WMOfJboMhqA/maintain_scroll_position.aspx</link><feedburner:origLink>http://dotnettipoftheday.org/tips/maintain_scroll_position.aspx</feedburner:origLink></item>
    <item>
      <title>Strongly-typed access to previous page during cross-page postback</title>
      <description>&lt;p&gt;ASP.NET 2.0 introduced the concept of cross-page postbacks where one page could postback information to a page other than itself. This is done by setting the PostBackUrl property of a button to the name of the page that the button should postback data to.  Normally, the posted data can be accessed by doing something like PreviousPage.FindControl("ControlID").  However, this requires a cast if you need to access properties of the target control in the previous page (which you normally need to do).  If you add a public property into the code-behind page that initiates the postback operation, you can access the property in a strongly-typed manner by adding the PreviousPageType directive into the target page of the postback.&lt;/p&gt;

&lt;p&gt;For example, if you have a page called Default.aspx that exposes a public property that returns a Textbox that is defined in the page, the page that data is posted to (lets call it SearchResults.aspx) can access that property in a strongly-typed manner (no FindControl() call is necessary) by adding the PreviousPageType directive into the top of the page:&lt;/p&gt;

&lt;div style="font-family: Courier New; font-size: 10pt; color: black; background: white;"&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="background-color:yellow"&gt;&amp;lt;%&lt;/span&gt;&lt;span style="color:blue"&gt;@&lt;/span&gt; &lt;span style="color:#a31515"&gt;PreviousPageType&lt;/span&gt; &lt;span style="color:red"&gt;VirtualPath&lt;/span&gt;&lt;span style="color:blue"&gt;="Default.aspx"&lt;/span&gt; &lt;span style="background-color:yellow"&gt;%&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;By adding this directive, the code in SearchResults.aspx can access the TextBox defined in Default.aspx in a strongly-typed manner.  The following example assumes the property defined in Default.aspx is named SearchTextBox.&lt;/p&gt;

&lt;div style="font-family: Courier New; font-size: 10pt; color: black; background: white;"&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: #2b91af;"&gt;TextBox&lt;/span&gt; tb = PreviousPage.SearchTextBox;&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;This code obviously only works if the previous page is Default.aspx.  PreviousPageType also has a TypeName property as well where you could define a base type that one or more pages derive from to make this technique work with multiple pages.&lt;/p&gt;


&lt;br /&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=strongly-typed-access-to-previous-page"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=strongly-typed-access-to-previous-page" border="0"/&gt;&lt;/a&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=nLZvwRpi43s:j7iNofD13EI:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=nLZvwRpi43s:j7iNofD13EI:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=nLZvwRpi43s:j7iNofD13EI:XQ266DUsA9M"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=XQ266DUsA9M" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=nLZvwRpi43s:j7iNofD13EI:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=nLZvwRpi43s:j7iNofD13EI:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=nLZvwRpi43s:j7iNofD13EI:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=nLZvwRpi43s:j7iNofD13EI:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=nLZvwRpi43s:j7iNofD13EI:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=nLZvwRpi43s:j7iNofD13EI:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=nLZvwRpi43s:j7iNofD13EI:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotNetTipOfTheDay/~4/nLZvwRpi43s" height="1" width="1"/&gt;</description>
      <guid isPermaLink="false">http://dotnettipoftheday.org/tips/strongly-typed-access-to-previous-page.aspx</guid>
      <pubDate>Thu, 02 Aug 2007 00:00:00 GMT</pubDate>
      <wfw:commentRss>http://dotnettipoftheday.org/tips/CommentsRss.aspx?tipid=strongly-typed-access-to-previous-page</wfw:commentRss>
    <link>http://feedproxy.google.com/~r/dotNetTipOfTheDay/~3/nLZvwRpi43s/strongly-typed-access-to-previous-page.aspx</link><feedburner:origLink>http://dotnettipoftheday.org/tips/strongly-typed-access-to-previous-page.aspx</feedburner:origLink></item>
    <item>
      <title>How to get virtual path of web application</title>
      <description>&lt;p&gt;Getting the virtual paths local to server is pretty straight forward most of the time; just use Page.ResolveURL("http://dotnettipoftheday.org/whatever"). But what if you're in the BLL part of your app?  Seeing as the Page.ResolveURL is not a static method you would have to create a new instance of Page before you can reference it... not good enough.&lt;/p&gt;
&lt;p&gt;In BLL use &lt;a href="http://msdn2.microsoft.com/en-us/library/system.web.httpruntime.appdomainappvirtualpath.aspx"&gt;System.Web.HttpRuntime.AppDomainAppVirtualPath&lt;/a&gt; static property to get local virtual path of web application:&lt;/p&gt;

&lt;div style="font-family: Courier New; font-size: 10pt; color: black; background: white;"&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;string&lt;/span&gt; url = &lt;span style="color: #2b91af;"&gt;HttpRuntime&lt;/span&gt;.AppDomainAppVirtualPath + &lt;span style="color: #a31515;"&gt;"/whatever"&lt;/span&gt;;&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Note: if web application is in a server root folder AppDomainAppVirtualPath returns just "/". If web application is in a non-root folder it returns virtual path of the folder without "/" in the end.&lt;/p&gt;&lt;br /&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=HttpRuntime.AppDomainAppVirtualPath"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=HttpRuntime.AppDomainAppVirtualPath" border="0"/&gt;&lt;/a&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=HFHVzHOc9tg:Z3Xe8gLFJGI:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=HFHVzHOc9tg:Z3Xe8gLFJGI:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=HFHVzHOc9tg:Z3Xe8gLFJGI:XQ266DUsA9M"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=XQ266DUsA9M" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=HFHVzHOc9tg:Z3Xe8gLFJGI:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=HFHVzHOc9tg:Z3Xe8gLFJGI:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=HFHVzHOc9tg:Z3Xe8gLFJGI:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=HFHVzHOc9tg:Z3Xe8gLFJGI:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=HFHVzHOc9tg:Z3Xe8gLFJGI:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=HFHVzHOc9tg:Z3Xe8gLFJGI:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=HFHVzHOc9tg:Z3Xe8gLFJGI:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotNetTipOfTheDay/~4/HFHVzHOc9tg" height="1" width="1"/&gt;</description>
      <guid isPermaLink="false">http://dotnettipoftheday.org/tips/HttpRuntime.AppDomainAppVirtualPath.aspx</guid>
      <pubDate>Wed, 01 Aug 2007 00:00:00 GMT</pubDate>
      <wfw:commentRss>http://dotnettipoftheday.org/tips/CommentsRss.aspx?tipid=HttpRuntime.AppDomainAppVirtualPath</wfw:commentRss>
    <link>http://feedproxy.google.com/~r/dotNetTipOfTheDay/~3/HFHVzHOc9tg/HttpRuntime.AppDomainAppVirtualPath.aspx</link><feedburner:origLink>http://dotnettipoftheday.org/tips/HttpRuntime.AppDomainAppVirtualPath.aspx</feedburner:origLink></item>
    <item>
      <title>Strongly-typed access to Master Pages controls</title>
      <description>&lt;p&gt;If you have public properties defined in a Master Page that you'd like to access in a strongly-typed manner you can add the MasterType directive into a page as shown next:&lt;/p&gt;
&lt;div style="font-family: Courier New; font-size: 10pt; color: black; background: white;"&gt;
	&lt;p style="margin: 0px;"&gt;&lt;span style="background-color:yellow"&gt;&amp;lt;%&lt;/span&gt; &lt;span style="color:#a31515"&gt;MasterType&lt;/span&gt; &lt;span style="color:Red"&gt;VirtualPath&lt;/span&gt;&lt;span style="color:Blue"&gt;="MasterPage.master"&lt;/span&gt; &lt;span style="background-color:yellow"&gt;%&amp;gt;&lt;/span&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;You can then access properties in the target master page from a content page by writing code like the following:&lt;/p&gt;
&lt;div style="font-family: Consolas; font-size: 10pt; color: black; background: white;"&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;this&lt;/span&gt;.Master.HeaderText = &lt;span style="color: #a31515;"&gt;"Label updated using MasterType directive with VirtualPath attribute."&lt;/span&gt;;&lt;/p&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=strong_type_access_to_master_page"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=strong_type_access_to_master_page" border="0"/&gt;&lt;/a&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=VUZNxbfeaLM:mdHWukO9BAo:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=VUZNxbfeaLM:mdHWukO9BAo:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=VUZNxbfeaLM:mdHWukO9BAo:XQ266DUsA9M"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=XQ266DUsA9M" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=VUZNxbfeaLM:mdHWukO9BAo:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=VUZNxbfeaLM:mdHWukO9BAo:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=VUZNxbfeaLM:mdHWukO9BAo:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=VUZNxbfeaLM:mdHWukO9BAo:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=VUZNxbfeaLM:mdHWukO9BAo:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=VUZNxbfeaLM:mdHWukO9BAo:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=VUZNxbfeaLM:mdHWukO9BAo:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotNetTipOfTheDay/~4/VUZNxbfeaLM" height="1" width="1"/&gt;</description>
      <guid isPermaLink="false">http://dotnettipoftheday.org/tips/strong_type_access_to_master_page.aspx</guid>
      <pubDate>Tue, 31 Jul 2007 00:00:00 GMT</pubDate>
      <wfw:commentRss>http://dotnettipoftheday.org/tips/CommentsRss.aspx?tipid=strong_type_access_to_master_page</wfw:commentRss>
    <link>http://feedproxy.google.com/~r/dotNetTipOfTheDay/~3/VUZNxbfeaLM/strong_type_access_to_master_page.aspx</link><feedburner:origLink>http://dotnettipoftheday.org/tips/strong_type_access_to_master_page.aspx</feedburner:origLink></item>
    <item>
      <title>Conditional compilation with ConditionalAttribute</title>
      <description>&lt;p&gt;It is possible to conditionally compile code out of the final product, this is usually useful when you want to have extra checks in the code (asserts, invariant checking) during development and testing, in debug mode, but do not want to incur the cost of this checking in the final release product. Just put all of the checking into a method and place Conditional attribute on it.&lt;/p&gt;

&lt;div style="font-family: Consolas; font-size: 10pt; color: black; background: white;"&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;sealed&lt;/span&gt; &lt;span style="color: blue;"&gt;class&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;Debug&lt;/span&gt;&lt;/p&gt;
&lt;p style=;margin: 0px;"&gt;{&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; ...&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; [&lt;span style="color: #2b91af;"&gt;Conditional&lt;/span&gt;(&lt;span style="color: #a31515;"&gt;"DEBUG"&lt;/span&gt;)]&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;static&lt;/span&gt; &lt;span style="color: blue;"&gt;void&lt;/span&gt; Assert(&lt;span style="color: blue;"&gt;bool&lt;/span&gt; condition, &lt;span style="color: blue;"&gt;string&lt;/span&gt; message)&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; {&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:#2b91af;"&gt;TraceInternal&lt;/span&gt;.Assert(condition, message);&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp; }&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;}&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;What this actually does is tell the compiler to only call the method when the supplied preprocessor symbol is defined. The method will still be compiled and will still exist in the assembly. So, in a debug build a program that looks like this:&lt;/p&gt;

&lt;div style="font-family: Consolas; font-size: 10pt; color: black; background: white;"&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;static&lt;/span&gt; &lt;span style="color: blue;"&gt;void&lt;/span&gt; Main(&lt;span style="color: blue;"&gt;string&lt;/span&gt;[] args)&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;{&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Debug.Assert(&lt;span style="color: blue;"&gt;true&lt;/span&gt;, &lt;span style="color: #a31515;"&gt;"This condition must be true"&lt;/span&gt;);&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;}&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;will still look like that, but when compiled in release mode, will look like this:&lt;/p&gt;

&lt;div style="font-family: Consolas; font-size: 10pt; color: black; background: white;"&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;private&lt;/span&gt; &lt;span style="color: blue;"&gt;static&lt;/span&gt; &lt;span style="color: blue;"&gt;void&lt;/span&gt; Main(&lt;span style="color: blue;"&gt;string&lt;/span&gt;[] args)&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;{&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;}&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;Note: the Debug classe of the .NET Framework use the ConditionalAttribute. So you don't have to worry about any performance hit whatsoever when you call various methods of this class as a debugging aid. These calls just won't make it in the release build.&lt;/p&gt;&lt;br /&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=conditional_attribute"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=conditional_attribute" border="0"/&gt;&lt;/a&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=_B6TJ2q0ED4:qR-leJuZEBQ:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=_B6TJ2q0ED4:qR-leJuZEBQ:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=_B6TJ2q0ED4:qR-leJuZEBQ:XQ266DUsA9M"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=XQ266DUsA9M" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=_B6TJ2q0ED4:qR-leJuZEBQ:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=_B6TJ2q0ED4:qR-leJuZEBQ:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=_B6TJ2q0ED4:qR-leJuZEBQ:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=_B6TJ2q0ED4:qR-leJuZEBQ:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=_B6TJ2q0ED4:qR-leJuZEBQ:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=_B6TJ2q0ED4:qR-leJuZEBQ:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=_B6TJ2q0ED4:qR-leJuZEBQ:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotNetTipOfTheDay/~4/_B6TJ2q0ED4" height="1" width="1"/&gt;</description>
      <guid isPermaLink="false">http://dotnettipoftheday.org/tips/conditional_attribute.aspx</guid>
      <pubDate>Fri, 27 Jul 2007 00:00:00 GMT</pubDate>
      <wfw:commentRss>http://dotnettipoftheday.org/tips/CommentsRss.aspx?tipid=conditional_attribute</wfw:commentRss>
    <link>http://feedproxy.google.com/~r/dotNetTipOfTheDay/~3/_B6TJ2q0ED4/conditional_attribute.aspx</link><feedburner:origLink>http://dotnettipoftheday.org/tips/conditional_attribute.aspx</feedburner:origLink></item>
    <item>
      <title>How to locate control nested inside of another control</title>
      <description>&lt;p&gt;Finding controls within a Page's control hierarchy can be painful but if you know how the controls are nested you can use the lesser known "$" shortcut to find controls without having to write recursive code. The following example shows how to use the DefaultFocus property to set the focus on a textbox that is nested inside of a FormView control. Notice that the "$" is used to delimit the nesting:&lt;/p&gt;
&lt;div style="font-family: Courier New; font-size: 10pt; color: black; background: white;"&gt;
	&lt;p style="margin: 0px;"&gt;&lt;span style="color:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;form&lt;/span&gt; &lt;span style="color:Red"&gt;id&lt;/span&gt;&lt;span style="color:Blue"&gt;="form1"&lt;/span&gt; &lt;span style="color:Red"&gt;DefaultFocus&lt;/span&gt;&lt;span style="color:Blue"&gt;="formVw$txtName"&lt;/span&gt; &lt;span style="color:Red"&gt;runat&lt;/span&gt;&lt;span style="color:Blue"&gt;="server"&amp;gt;&lt;/span&gt;&lt;/p&gt;
	&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;div&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
	&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;asp&lt;/span&gt;&lt;span style="color:blue"&gt;:&lt;/span&gt;&lt;span style="color:#a31515"&gt;FormView&lt;/span&gt; &lt;span style="color:red"&gt;ID&lt;/span&gt;&lt;span style="color:blue"&gt;="formVw"&lt;/span&gt; &lt;span style="color:red"&gt;runat&lt;/span&gt;&lt;span style="color:blue"&gt;="server"&amp;gt;&lt;/span&gt;&lt;/p&gt;
	&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;ItemTemplate&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
	&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Name:&lt;/p&gt;
	&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;asp&lt;/span&gt;&lt;span style="color:blue"&gt;:&lt;/span&gt;&lt;span style="color:#a31515"&gt;TextBox&lt;/span&gt; &lt;span style="color:red"&gt;ID&lt;/span&gt;&lt;span style="color:blue"&gt;="txtName"&lt;/span&gt; &lt;span style="color:red"&gt;runat&lt;/span&gt;&lt;span style="color:blue"&gt;="server"&lt;/span&gt;&lt;/p&gt;
	&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:red"&gt;Text&lt;/span&gt;&lt;span style="color:blue"&gt;='&lt;/span&gt;&lt;span style="background-color:yellow"&gt;&amp;lt;%&lt;/span&gt;# Eval("FirstName") + " " + Eval("LastName") &lt;span style="background-color:yellow"&gt;%&amp;gt;&lt;/span&gt;&lt;span style="color:blue"&gt;' /&amp;gt;&lt;/span&gt;&lt;/p&gt;
	&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;ItemTemplate&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
	&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;asp&lt;/span&gt;&lt;span style="color:blue"&gt;:&lt;/span&gt;&lt;span style="color:#a31515"&gt;FormView&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
	&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;div&lt;/span&gt;&lt;span style="color:blue"&gt;&amp;gt;&lt;/span&gt;&lt;/p&gt;
	&lt;p style="margin: 0px;"&gt;&lt;span style="color:Blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;form&lt;/span&gt;&lt;span style="color:Blue"&gt;&amp;gt;&lt;/span&gt;
&lt;/div&gt;

&lt;p&gt;This little trick can also be used on the server-side when calling FindControl():&lt;/p&gt;
&lt;div style="font-family: Consolas; font-size: 10pt; color: black; background: white;"&gt;
&lt;p style="margin: 0px;"&gt;TextBox tb = &lt;span style="color: blue;"&gt;this&lt;/span&gt;.FindControl(&lt;span style="color: #a31515;"&gt;"form1$formVw$txtName"&lt;/span&gt;) &lt;span style="color: blue;"&gt;as&lt;/span&gt; TextBox;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;if&lt;/span&gt; (tb != &lt;span style="color: blue;"&gt;null&lt;/span&gt;)&lt;/p&gt;
&lt;p style="margin: 0px;"&gt; {&lt;/p&gt;
&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: green;"&gt;//Access TextBox control&lt;/span&gt;&lt;/p&gt;
&lt;p style="margin: 0px;"&gt; }&lt;/p&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=locate_nested_control"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=locate_nested_control" border="0"/&gt;&lt;/a&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=6-T2PduOCUE:ZKMbD4pMWsA:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=6-T2PduOCUE:ZKMbD4pMWsA:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=6-T2PduOCUE:ZKMbD4pMWsA:XQ266DUsA9M"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=XQ266DUsA9M" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=6-T2PduOCUE:ZKMbD4pMWsA:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=6-T2PduOCUE:ZKMbD4pMWsA:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=6-T2PduOCUE:ZKMbD4pMWsA:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=6-T2PduOCUE:ZKMbD4pMWsA:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=6-T2PduOCUE:ZKMbD4pMWsA:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=6-T2PduOCUE:ZKMbD4pMWsA:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=6-T2PduOCUE:ZKMbD4pMWsA:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotNetTipOfTheDay/~4/6-T2PduOCUE" height="1" width="1"/&gt;</description>
      <guid isPermaLink="false">http://dotnettipoftheday.org/tips/locate_nested_control.aspx</guid>
      <pubDate>Thu, 26 Jul 2007 00:00:00 GMT</pubDate>
      <wfw:commentRss>http://dotnettipoftheday.org/tips/CommentsRss.aspx?tipid=locate_nested_control</wfw:commentRss>
    <link>http://feedproxy.google.com/~r/dotNetTipOfTheDay/~3/6-T2PduOCUE/locate_nested_control.aspx</link><feedburner:origLink>http://dotnettipoftheday.org/tips/locate_nested_control.aspx</feedburner:origLink></item>
    <item>
      <title>How to set the default focus to a control when the page loads</title>
      <description>&lt;p&gt;This is another extremely simple thing that can be done without resorting to writing JavaScript.
If you only have a single textbox (or two) on a page why should the user have to click in the textbox 
to start typing?  Shouldn't the cursor already be blinking in the textbox so they can type away? Using the 
DefaultFocus property of the HtmlForm control you can easily do this.&lt;/p&gt;
&lt;div style="font-family: Courier New; font-size: 10pt; color: black; background: white;"&gt;
	&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;form&lt;/span&gt; &lt;span style="color:red;"&gt;id&lt;/span&gt;&lt;span style="color:Blue"&gt;="frm"&lt;/span&gt; &lt;span style="color:Red"&gt;DefaultFocus&lt;/span&gt;&lt;span style="color:Blue"&gt;="txtUserName"&lt;/span&gt; &lt;span style="color:Red"&gt;runat&lt;/span&gt;&lt;span style="color:Blue"&gt;="server"&amp;gt;&lt;/span&gt;&lt;/p&gt;
	&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;...&lt;/p&gt;
	&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:Blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;form&lt;/span&gt;&lt;span style="color:Blue"&gt;&amp;gt;&lt;/span&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=default_focus"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=default_focus" border="0"/&gt;&lt;/a&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=7K5ZzMSQXjU:tiJFEy7W3rw:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=7K5ZzMSQXjU:tiJFEy7W3rw:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=7K5ZzMSQXjU:tiJFEy7W3rw:XQ266DUsA9M"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=XQ266DUsA9M" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=7K5ZzMSQXjU:tiJFEy7W3rw:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=7K5ZzMSQXjU:tiJFEy7W3rw:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=7K5ZzMSQXjU:tiJFEy7W3rw:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=7K5ZzMSQXjU:tiJFEy7W3rw:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=7K5ZzMSQXjU:tiJFEy7W3rw:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=7K5ZzMSQXjU:tiJFEy7W3rw:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=7K5ZzMSQXjU:tiJFEy7W3rw:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotNetTipOfTheDay/~4/7K5ZzMSQXjU" height="1" width="1"/&gt;</description>
      <guid isPermaLink="false">http://dotnettipoftheday.org/tips/default_focus.aspx</guid>
      <pubDate>Wed, 25 Jul 2007 00:00:00 GMT</pubDate>
      <wfw:commentRss>http://dotnettipoftheday.org/tips/CommentsRss.aspx?tipid=default_focus</wfw:commentRss>
    <link>http://feedproxy.google.com/~r/dotNetTipOfTheDay/~3/7K5ZzMSQXjU/default_focus.aspx</link><feedburner:origLink>http://dotnettipoftheday.org/tips/default_focus.aspx</feedburner:origLink></item>
    <item>
      <title>Set the default button that is triggered when the user hits the Enter key</title>
      <description>&lt;p&gt;
			Use the HtmlForm control's &lt;a href="http://msdn2.microsoft.com/en-us/library/system.web.ui.htmlcontrols.htmlform.defaultbutton.aspx"&gt;DefaultButton&lt;/a&gt; property to set which button should
			be clicked when the user hits enter. This property is also available on the
			Panel control in cases where different buttons should be triggered as a 
			user moves into different Panels on a page.
			&lt;/p&gt;
			&lt;div style="font-family: Courier New; font-size: 10pt; color: black; background: white;"&gt;
				&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:blue;"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color:#a31515"&gt;form&lt;/span&gt; &lt;span style="color:Red"&gt;id&lt;/span&gt;&lt;span style="color:Blue"&gt;="frm"&lt;/span&gt; &lt;span style="color:Red"&gt;DefaultButton&lt;/span&gt;&lt;span style="color:Blue"&gt;="btnSubmit"&lt;/span&gt; &lt;span style="color:Red"&gt;runat&lt;/span&gt;&lt;span style="color:Blue"&gt;="server"&amp;gt;&lt;/span&gt;&lt;/p&gt;
				&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;...&lt;/p&gt;
				&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:Blue"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color:#a31515"&gt;form&lt;/span&gt;&lt;span style="color:Blue"&gt;&amp;gt;&lt;/span&gt;
			&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=default_button"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=default_button" border="0"/&gt;&lt;/a&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=lfoU99lXrm8:g6nL34GWudI:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=lfoU99lXrm8:g6nL34GWudI:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=lfoU99lXrm8:g6nL34GWudI:XQ266DUsA9M"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=XQ266DUsA9M" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=lfoU99lXrm8:g6nL34GWudI:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=lfoU99lXrm8:g6nL34GWudI:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=lfoU99lXrm8:g6nL34GWudI:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=lfoU99lXrm8:g6nL34GWudI:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=lfoU99lXrm8:g6nL34GWudI:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=lfoU99lXrm8:g6nL34GWudI:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=lfoU99lXrm8:g6nL34GWudI:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotNetTipOfTheDay/~4/lfoU99lXrm8" height="1" width="1"/&gt;</description>
      <guid isPermaLink="false">http://dotnettipoftheday.org/tips/default_button.aspx</guid>
      <pubDate>Tue, 24 Jul 2007 00:00:00 GMT</pubDate>
      <wfw:commentRss>http://dotnettipoftheday.org/tips/CommentsRss.aspx?tipid=default_button</wfw:commentRss>
    <link>http://feedproxy.google.com/~r/dotNetTipOfTheDay/~3/lfoU99lXrm8/default_button.aspx</link><feedburner:origLink>http://dotnettipoftheday.org/tips/default_button.aspx</feedburner:origLink></item>
    <item>
      <title>How to change the default browser used in VS 2005</title>
      <description>&lt;p&gt;
			To change what browser is launched and used when running web apps in Visual Studio 2005 and 
			Visual Web Developer (for example: to use FireFox instead of IE) do this:&lt;/p&gt;
			&lt;ol&gt;
				&lt;li&gt;Right click on a .aspx page in your solution explorer&lt;/li&gt;
				&lt;li&gt;Select the "browse with" context menu option&lt;/li&gt;
				&lt;li&gt;In the dialog you can select or add a browser.  If you want Firefox in the list, click "add" and point to the firefox.exe filename&lt;/li&gt;
				&lt;li&gt;Click the "Set as Default" button to make this the default browser when you run any page on the site.&lt;/li&gt;
			&lt;/ol&gt;
			
			&lt;p&gt;Note that there is also an optional drop-down at the bottom of the dialog that lets you select
			the default browser window size when loading.
			&lt;/p&gt;&lt;br /&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=default_browser_in_VS2005"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=default_browser_in_VS2005" border="0"/&gt;&lt;/a&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=7Be5v9_vb9c:UCNkVnFFOF4:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=7Be5v9_vb9c:UCNkVnFFOF4:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=7Be5v9_vb9c:UCNkVnFFOF4:XQ266DUsA9M"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=XQ266DUsA9M" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=7Be5v9_vb9c:UCNkVnFFOF4:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=7Be5v9_vb9c:UCNkVnFFOF4:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=7Be5v9_vb9c:UCNkVnFFOF4:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=7Be5v9_vb9c:UCNkVnFFOF4:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=7Be5v9_vb9c:UCNkVnFFOF4:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=7Be5v9_vb9c:UCNkVnFFOF4:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=7Be5v9_vb9c:UCNkVnFFOF4:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotNetTipOfTheDay/~4/7Be5v9_vb9c" height="1" width="1"/&gt;</description>
      <guid isPermaLink="false">http://dotnettipoftheday.org/tips/default_browser_in_VS2005.aspx</guid>
      <pubDate>Mon, 23 Jul 2007 00:00:00 GMT</pubDate>
      <wfw:commentRss>http://dotnettipoftheday.org/tips/CommentsRss.aspx?tipid=default_browser_in_VS2005</wfw:commentRss>
    <link>http://feedproxy.google.com/~r/dotNetTipOfTheDay/~3/7Be5v9_vb9c/default_browser_in_VS2005.aspx</link><feedburner:origLink>http://dotnettipoftheday.org/tips/default_browser_in_VS2005.aspx</feedburner:origLink></item>
    <item>
      <title>Use server-side comments to temporary disable part of ASP.NET page</title>
      <description>&lt;p&gt;
			You are coding away on an ASP.NET page, and are trying to isolate a 
			problem within the page.  You have some existing 
			html/controls/markup/in-line code that is being used on the page, and 
			you want to temporarily comment it out while you fix the problem.&lt;br /&gt;
			ASP.NET supports a little known feature called “server-side comments” 
			that you can use to completely disable code/controls/html in a page.  
			Server-side comments in ASP.NET are delimited using a 
			&lt;span style="white-space:nowrap"&gt;&lt;span style="background-color:Yellow"&gt;&amp;lt;%&lt;/span&gt;&lt;span style="color:Green"&gt;--&lt;/span&gt;
			 &lt;span style="color:Green"&gt;--&lt;/span&gt;&lt;span style="background-color:Yellow"&gt;%&amp;gt;&lt;/span&gt;&lt;/span&gt; syntax. For example:&lt;/p&gt;

			&lt;div style="font-family: Courier New; font-size: 10pt; color: black; background: white;"&gt;
				&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="background-color:Yellow"&gt;&amp;lt;%&lt;/span&gt;&lt;span style="color:Green"&gt;--&lt;/span&gt;&lt;/p&gt;
				&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:Green"&gt;Commented out HTML/CODE/Markup. Anything with&lt;/span&gt;&lt;/p&gt;
				&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:Green"&gt;this block will not be parsed/handled by ASP.NET.&lt;/span&gt;&lt;/p&gt;
				&lt;p style="margin: 0px;"&gt;&amp;nbsp;&lt;/p&gt;
				&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:Green"&gt;&amp;lt;asp:Calendar runat="server"&amp;gt;&amp;lt;/asp:Calendar&amp;gt;&lt;/span&gt;&lt;/p&gt;
				&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:Green"&gt;&amp;lt;%# Eval("SomeProperty") %&amp;gt;&lt;/span&gt;&lt;/p&gt;
				&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:Green"&gt;--&lt;/span&gt;&lt;span style="background-color:Yellow"&gt;%&amp;gt;&lt;/span&gt;&lt;/p&gt;
			&lt;/div&gt;

			&lt;p&gt;The key difference between client-side HTML comments and server-side comments
			 is that with client-side comments code/controls will still be executed on 
			 the server. With server-side comments, the ASP.NET compiler will ignore 
			 everything whithin these blocks.
			&lt;/p&gt;&lt;br /&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=server_side_comments"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=server_side_comments" border="0"/&gt;&lt;/a&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=hTgDlJ_VP98:QecPdNakTtY:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=hTgDlJ_VP98:QecPdNakTtY:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=hTgDlJ_VP98:QecPdNakTtY:XQ266DUsA9M"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=XQ266DUsA9M" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=hTgDlJ_VP98:QecPdNakTtY:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=hTgDlJ_VP98:QecPdNakTtY:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=hTgDlJ_VP98:QecPdNakTtY:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=hTgDlJ_VP98:QecPdNakTtY:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=hTgDlJ_VP98:QecPdNakTtY:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=hTgDlJ_VP98:QecPdNakTtY:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=hTgDlJ_VP98:QecPdNakTtY:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotNetTipOfTheDay/~4/hTgDlJ_VP98" height="1" width="1"/&gt;</description>
      <guid isPermaLink="false">http://dotnettipoftheday.org/tips/server_side_comments.aspx</guid>
      <pubDate>Sat, 21 Jul 2007 00:00:00 GMT</pubDate>
      <wfw:commentRss>http://dotnettipoftheday.org/tips/CommentsRss.aspx?tipid=server_side_comments</wfw:commentRss>
    <link>http://feedproxy.google.com/~r/dotNetTipOfTheDay/~3/hTgDlJ_VP98/server_side_comments.aspx</link><feedburner:origLink>http://dotnettipoftheday.org/tips/server_side_comments.aspx</feedburner:origLink></item>
    <item>
      <title>Use parameters instead of string concatenation for forming SQL queries</title>
      <description>&lt;p&gt;String concatenation is not a secure approach as clever person can execute unwanted SQL statement by some tricks (&lt;a href="http://en.wikipedia.org/wiki/SQL_injection"&gt;SQL injection attack&lt;/a&gt;). Use parameters if possible.&lt;/p&gt;
			&lt;p&gt;Bad code:&lt;/p&gt;
			&lt;div style="font-family: Courier New; font-size: 10pt; color: black; background: white;"&gt;
				&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #2b91af;"&gt;SqlCommand&lt;/span&gt; command = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;SqlCommand&lt;/span&gt;(&lt;span style="color: #a31515;"&gt;"SELECT COUNT(*) FROM Accounts WHERE Login=&lt;span style="background-color:#FF8F3D"&gt;'"&lt;/span&gt;&lt;/span&gt;&lt;span style="background-color:#FF8F3D"&gt; + login + &lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span style="background-color:#FF8F3D"&gt;"'&lt;/span&gt; AND Password=&lt;span style="background-color:#FF8F3D"&gt;'"&lt;/span&gt;&lt;/span&gt;&lt;span style="background-color:#FF8F3D"&gt; + password + &lt;/span&gt;&lt;span style="color: #a31515;"&gt;&lt;span style="background-color:#FF8F3D"&gt;"'&lt;/span&gt;"&lt;/span&gt;, conn);&lt;/p&gt;
			&lt;/div&gt;
			&lt;p&gt;Good code:&lt;/p&gt;
			&lt;div style="font-family: Courier New; font-size: 10pt; color: black; background: white;"&gt;
			&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #2b91af;"&gt;SqlCommand&lt;/span&gt; command = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;SqlCommand&lt;/span&gt;(&lt;span style="color: #a31515;"&gt;"SELECT COUNT(*) FROM Accounts WHERE &lt;span style="background-color:#AEF077"&gt;Login=@login&lt;/span&gt; AND &lt;span style="background-color:#AEF077"&gt;Password=@password&lt;/span&gt;"&lt;/span&gt;, conn);&lt;/p&gt;
			&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: #2b91af;"&gt;SqlParameter&lt;/span&gt; param = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;SqlParameter&lt;/span&gt;(&lt;span style="color: #a31515;"&gt;"login"&lt;/span&gt;, &lt;span style="color: #2b91af;"&gt;SqlDbType&lt;/span&gt;.VarChar, 100);&lt;/p&gt;
			&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="background-color:#AEF077"&gt;param.Value = login;&lt;/span&gt;&lt;/p&gt;
			&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; command.Parameters.Add(param);&lt;/p&gt;
			&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; param = &lt;span style="color: blue;"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;SqlParameter&lt;/span&gt;(&lt;span style="color: #a31515;"&gt;"password"&lt;/span&gt;, &lt;span style="color: #2b91af;"&gt;SqlDbType&lt;/span&gt;.VarChar, 100);&lt;/p&gt;
			&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="background-color:#AEF077"&gt;param.Value = password;&lt;/span&gt;&lt;/p&gt;
			&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; command.Parameters.Add(param);&lt;/p&gt;
			&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=parameters_instead_of_concatenation"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=parameters_instead_of_concatenation" border="0"/&gt;&lt;/a&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=bxme271-73w:3E7T0m79v5U:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=bxme271-73w:3E7T0m79v5U:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=bxme271-73w:3E7T0m79v5U:XQ266DUsA9M"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=XQ266DUsA9M" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=bxme271-73w:3E7T0m79v5U:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=bxme271-73w:3E7T0m79v5U:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=bxme271-73w:3E7T0m79v5U:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=bxme271-73w:3E7T0m79v5U:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=bxme271-73w:3E7T0m79v5U:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=bxme271-73w:3E7T0m79v5U:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=bxme271-73w:3E7T0m79v5U:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotNetTipOfTheDay/~4/bxme271-73w" height="1" width="1"/&gt;</description>
      <guid isPermaLink="false">http://dotnettipoftheday.org/tips/parameters_instead_of_concatenation.aspx</guid>
      <pubDate>Fri, 20 Jul 2007 00:00:00 GMT</pubDate>
      <wfw:commentRss>http://dotnettipoftheday.org/tips/CommentsRss.aspx?tipid=parameters_instead_of_concatenation</wfw:commentRss>
    <link>http://feedproxy.google.com/~r/dotNetTipOfTheDay/~3/bxme271-73w/parameters_instead_of_concatenation.aspx</link><feedburner:origLink>http://dotnettipoftheday.org/tips/parameters_instead_of_concatenation.aspx</feedburner:origLink></item>
    <item>
      <title>Use &amp;quot;App_Offline.htm&amp;quot; feature while updating a web site</title>
      <description>&lt;p&gt;"App_Offline.htm" feature provides a super convenient way to bring 
		down an ASP.NET application while you updating a lot of content or making
		 big changes to the site where you want to ensure that no users are 
		 accessing the application until all changes are done.
		&lt;/p&gt;
		&lt;p&gt;The way app_offline.htm works is that you place this file in the root of 
		the application. When ASP.NET sees it, it will shut-down the app-domain 
		for the application and instead send back the contents of the 
		app_offline.htm file in response to all new dynamic requests for the 
		application.  When you are done updating the site, just delete the 
		file and it will come back online.
		&lt;/p&gt;&lt;br /&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=app_offline.htm"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=app_offline.htm" border="0"/&gt;&lt;/a&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=kRfzaSqjO1w:GK5i6WDHnj8:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=kRfzaSqjO1w:GK5i6WDHnj8:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=kRfzaSqjO1w:GK5i6WDHnj8:XQ266DUsA9M"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=XQ266DUsA9M" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=kRfzaSqjO1w:GK5i6WDHnj8:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=kRfzaSqjO1w:GK5i6WDHnj8:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=kRfzaSqjO1w:GK5i6WDHnj8:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=kRfzaSqjO1w:GK5i6WDHnj8:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=kRfzaSqjO1w:GK5i6WDHnj8:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=kRfzaSqjO1w:GK5i6WDHnj8:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=kRfzaSqjO1w:GK5i6WDHnj8:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotNetTipOfTheDay/~4/kRfzaSqjO1w" height="1" width="1"/&gt;</description>
      <guid isPermaLink="false">http://dotnettipoftheday.org/tips/app_offline.htm.aspx</guid>
      <pubDate>Thu, 19 Jul 2007 00:00:00 GMT</pubDate>
      <wfw:commentRss>http://dotnettipoftheday.org/tips/CommentsRss.aspx?tipid=app_offline.htm</wfw:commentRss>
    <link>http://feedproxy.google.com/~r/dotNetTipOfTheDay/~3/kRfzaSqjO1w/app_offline.htm.aspx</link><feedburner:origLink>http://dotnettipoftheday.org/tips/app_offline.htm.aspx</feedburner:origLink></item>
    <item>
      <title>Use on-demand web-site compilation option to improve build times</title>
      <description>&lt;p&gt;On-demand web-site compilation mode means that when you edit page 
			and then hit F5 (run with debugging) or Ctrl-F5 (run without debugging) 
			the solution will compile all of the class library projects, then 
			compile the /app_code directory and Global.asax file, and then 
			instead of re-verifying all pages within the web-site it will only 
			verify the current page you are working on, and any user controls 
			that the page references. Note that ASP.NET will automatically 
			re-compile any other page or control you access at runtime - so 
			you will always have an up-to-date and current running application 
			(you don't need to worry about old code running). 
			&lt;/p&gt;
			&lt;p&gt;To enable this, right-click on your web-site project and pull 
			up the project properties page.  Click the "Build" tab on the left 
			to pull up its build settings.  Within the "Build" tab settings 
			page change the F5 Start Action from "Build Web Site" to 
			the "Build Page" option:&lt;br /&gt;
			&lt;img src="http://dotnettipoftheday.org/resources/on_demand_compilation.png" alt="Web-site On-demand Compilation" runat="server" /&gt;
			&lt;/p&gt;&lt;br /&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=on_demand_compilation"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=on_demand_compilation" border="0"/&gt;&lt;/a&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=PdSkU1EQNDw:JuZva92lvc0:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=PdSkU1EQNDw:JuZva92lvc0:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=PdSkU1EQNDw:JuZva92lvc0:XQ266DUsA9M"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=XQ266DUsA9M" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=PdSkU1EQNDw:JuZva92lvc0:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=PdSkU1EQNDw:JuZva92lvc0:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=PdSkU1EQNDw:JuZva92lvc0:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=PdSkU1EQNDw:JuZva92lvc0:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=PdSkU1EQNDw:JuZva92lvc0:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=PdSkU1EQNDw:JuZva92lvc0:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=PdSkU1EQNDw:JuZva92lvc0:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotNetTipOfTheDay/~4/PdSkU1EQNDw" height="1" width="1"/&gt;</description>
      <guid isPermaLink="false">http://dotnettipoftheday.org/tips/on_demand_compilation.aspx</guid>
      <pubDate>Wed, 18 Jul 2007 00:00:00 GMT</pubDate>
      <wfw:commentRss>http://dotnettipoftheday.org/tips/CommentsRss.aspx?tipid=on_demand_compilation</wfw:commentRss>
    <link>http://feedproxy.google.com/~r/dotNetTipOfTheDay/~3/PdSkU1EQNDw/on_demand_compilation.aspx</link><feedburner:origLink>http://dotnettipoftheday.org/tips/on_demand_compilation.aspx</feedburner:origLink></item>
    <item>
      <title>Keep the number of files in your /app_code directory small</title>
      <description>&lt;p&gt;In order to improve Web Site Project build times keep number of files in 
			your /app_code directory small. If you end up having a lot of class files 
			within this directory, move them into separate class library project and 
			reference that project from your web-site. This isn't usually an issue if 
			you just have a small number of files in /app_code, but if you have lots 
			of directories or dozens of files you will be able to get speed 
			improvements.&lt;/p&gt;
			&lt;p&gt;One other thing to be aware of is that whenever you 
			switch from source to design-view within the Visual Studio HTML designer, the 
			designer causes the /app_code directory to be compiled before the designer 
			surface loads.  The reason for this is so that you can host controls 
			defined within /app_code in the designer.  If you don't have an /app_code 
			directory, or only have a few files defined within it, the page designer 
			will be able to load much quicker (since it doesn't need to perform a big 
			compilation first).
			&lt;/p&gt;&lt;br /&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=keep_app_code_directory_small"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=keep_app_code_directory_small" border="0"/&gt;&lt;/a&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=ASoNHorwDZ8:dgfkxTPiq_w:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=ASoNHorwDZ8:dgfkxTPiq_w:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=ASoNHorwDZ8:dgfkxTPiq_w:XQ266DUsA9M"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=XQ266DUsA9M" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=ASoNHorwDZ8:dgfkxTPiq_w:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=ASoNHorwDZ8:dgfkxTPiq_w:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=ASoNHorwDZ8:dgfkxTPiq_w:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=ASoNHorwDZ8:dgfkxTPiq_w:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=ASoNHorwDZ8:dgfkxTPiq_w:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=ASoNHorwDZ8:dgfkxTPiq_w:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=ASoNHorwDZ8:dgfkxTPiq_w:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotNetTipOfTheDay/~4/ASoNHorwDZ8" height="1" width="1"/&gt;</description>
      <guid isPermaLink="false">http://dotnettipoftheday.org/tips/keep_app_code_directory_small.aspx</guid>
      <pubDate>Tue, 17 Jul 2007 00:00:00 GMT</pubDate>
      <wfw:commentRss>http://dotnettipoftheday.org/tips/CommentsRss.aspx?tipid=keep_app_code_directory_small</wfw:commentRss>
    <link>http://feedproxy.google.com/~r/dotNetTipOfTheDay/~3/ASoNHorwDZ8/keep_app_code_directory_small.aspx</link><feedburner:origLink>http://dotnettipoftheday.org/tips/keep_app_code_directory_small.aspx</feedburner:origLink></item>
    <item>
      <title>Use DebuggerDisplay attribute for a better debugger experience</title>
      <description>&lt;p&gt;Appply &lt;a href="http://msdn2.microsoft.com/en-us/library/system.diagnostics.debuggerdisplayattribute.aspx"&gt;DebuggerDisplay&lt;/a&gt; attribute to a 
			class or member to determine how it is displayed in the debugger variable windows. 
			For example, the following C# code causes "Count = 4" to be displayed in 
			debugger:&lt;br /&gt;&lt;/p&gt;
			&lt;div style="font-family: Courier New; font-size: 10pt; color: black; background: white;"&gt;
			&lt;p style="margin: 0px;"&gt;[&lt;span style="color: #2b91af;"&gt;DebuggerDisplay&lt;/span&gt;(&lt;span style="color: #a31515;"&gt;"Count = {count}"&lt;/span&gt;)]&lt;/p&gt;
			&lt;p style="margin: 0px;"&gt;&lt;span style="color: blue;"&gt;class&lt;/span&gt; &lt;span style="color: #2b91af;"&gt;MyHashtable&lt;/span&gt;&lt;/p&gt;
			&lt;p style="margin: 0px;"&gt;{&lt;/p&gt;
			&lt;p style="margin: 0px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color: blue;"&gt;public&lt;/span&gt; &lt;span style="color: blue;"&gt;int&lt;/span&gt; count = 4;&lt;/p&gt;
			&lt;p style="margin: 0px;"&gt;}&lt;/p&gt;
			&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=debuggerdisplay_attribute"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=debuggerdisplay_attribute" border="0"/&gt;&lt;/a&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=6bJthaQjF1U:YgH8_zkgCS4:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=6bJthaQjF1U:YgH8_zkgCS4:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=6bJthaQjF1U:YgH8_zkgCS4:XQ266DUsA9M"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=XQ266DUsA9M" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=6bJthaQjF1U:YgH8_zkgCS4:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=6bJthaQjF1U:YgH8_zkgCS4:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=6bJthaQjF1U:YgH8_zkgCS4:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=6bJthaQjF1U:YgH8_zkgCS4:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=6bJthaQjF1U:YgH8_zkgCS4:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=6bJthaQjF1U:YgH8_zkgCS4:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=6bJthaQjF1U:YgH8_zkgCS4:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotNetTipOfTheDay/~4/6bJthaQjF1U" height="1" width="1"/&gt;</description>
      <guid isPermaLink="false">http://dotnettipoftheday.org/tips/debuggerdisplay_attribute.aspx</guid>
      <pubDate>Mon, 16 Jul 2007 00:00:00 GMT</pubDate>
      <wfw:commentRss>http://dotnettipoftheday.org/tips/CommentsRss.aspx?tipid=debuggerdisplay_attribute</wfw:commentRss>
    <link>http://feedproxy.google.com/~r/dotNetTipOfTheDay/~3/6bJthaQjF1U/debuggerdisplay_attribute.aspx</link><feedburner:origLink>http://dotnettipoftheday.org/tips/debuggerdisplay_attribute.aspx</feedburner:origLink></item>
    <item>
      <title>How to debug a JavaScript code</title>
      <description>&lt;p&gt;&lt;span style="text-decoration:underline"&gt;Method 1.&lt;/span&gt; Open .js file in Visual Studio and insert breakpoint at the line you want to debug. Open &lt;strong&gt;Attach to Process&lt;/strong&gt; dialog window (menu item &lt;strong&gt;Debug | Attach to Process...&lt;/strong&gt;) and attach to Internet Explorer process (iexplore.exe). Execute the code you want to debug in Internet Explorer.&lt;/p&gt;

&lt;p&gt;&lt;span style="text-decoration:underline"&gt;Method 2.&lt;/span&gt; Write your JavaScript and place the &lt;code&gt;debugger&lt;/code&gt; keyword where ever you want the code to break into debugging. The JavaScript interpreter hits this keyword and halts execution and returns the control back to the IDE. This is like setting a breakpoint inside of Visual Studio.&lt;br /&gt;&lt;br /&gt;

Note: you must enable script debugging in Internet Explorer to be able to debug. Go to &lt;strong&gt;Internet Options&lt;/strong&gt; inside Internet Explorer and then go to the &lt;strong&gt;Advanced&lt;/strong&gt; tab. Uncheck &lt;strong&gt;Disable script debugging (Internet Explorer)&lt;/strong&gt;.&lt;/p&gt;
&lt;div style="text-align:center;"&gt;&lt;img src="http://dotnettipoftheday.org/resources/debug_javascript.png" alt="Enable JavaScript Debugging" /&gt;&lt;/div&gt;&lt;br /&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=debug_javascript"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=debug_javascript" border="0"/&gt;&lt;/a&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=pkQe8LAQRBc:a4EriNGjoic:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=pkQe8LAQRBc:a4EriNGjoic:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=pkQe8LAQRBc:a4EriNGjoic:XQ266DUsA9M"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=XQ266DUsA9M" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=pkQe8LAQRBc:a4EriNGjoic:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=pkQe8LAQRBc:a4EriNGjoic:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=pkQe8LAQRBc:a4EriNGjoic:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=pkQe8LAQRBc:a4EriNGjoic:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=pkQe8LAQRBc:a4EriNGjoic:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=pkQe8LAQRBc:a4EriNGjoic:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=pkQe8LAQRBc:a4EriNGjoic:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotNetTipOfTheDay/~4/pkQe8LAQRBc" height="1" width="1"/&gt;</description>
      <guid isPermaLink="false">http://dotnettipoftheday.org/tips/debug_javascript.aspx</guid>
      <pubDate>Sun, 15 Jul 2007 00:00:00 GMT</pubDate>
      <wfw:commentRss>http://dotnettipoftheday.org/tips/CommentsRss.aspx?tipid=debug_javascript</wfw:commentRss>
    <link>http://feedproxy.google.com/~r/dotNetTipOfTheDay/~3/pkQe8LAQRBc/debug_javascript.aspx</link><feedburner:origLink>http://dotnettipoftheday.org/tips/debug_javascript.aspx</feedburner:origLink></item>
    <item>
      <title>Do not include the &amp;quot;@&amp;quot; character when supplying stored procedure parameter names to a SQL Server database</title>
      <description>&lt;p&gt;Avoid using database-specific tokens with stored procedure parameter names. 
ADO.NET classes for specific providers include code to adjust parameter names as 
required. This will ease migration existing ADO.NET programs to other DBMSs.
&lt;/p&gt;&lt;br /&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=database_specific_tokens"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=52ddf431a6834c29b72e7f6214a23d5a&amp;u=database_specific_tokens" border="0"/&gt;&lt;/a&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=OQuXnzezNNc:jEZB754ntpI:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=OQuXnzezNNc:jEZB754ntpI:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=OQuXnzezNNc:jEZB754ntpI:XQ266DUsA9M"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=XQ266DUsA9M" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=OQuXnzezNNc:jEZB754ntpI:gIN9vFwOqvQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=OQuXnzezNNc:jEZB754ntpI:gIN9vFwOqvQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=OQuXnzezNNc:jEZB754ntpI:V_sGLiPBpWU"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=OQuXnzezNNc:jEZB754ntpI:V_sGLiPBpWU" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=OQuXnzezNNc:jEZB754ntpI:yIl2AUoC8zA"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?d=yIl2AUoC8zA" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?a=OQuXnzezNNc:jEZB754ntpI:D7DqB2pKExk"&gt;&lt;img src="http://feeds.feedburner.com/~ff/dotNetTipOfTheDay?i=OQuXnzezNNc:jEZB754ntpI:D7DqB2pKExk" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/dotNetTipOfTheDay/~4/OQuXnzezNNc" height="1" width="1"/&gt;</description>
      <guid isPermaLink="false">http://dotnettipoftheday.org/tips/database_specific_tokens.aspx</guid>
      <pubDate>Sat, 14 Jul 2007 00:00:00 GMT</pubDate>
      <wfw:commentRss>http://dotnettipoftheday.org/tips/CommentsRss.aspx?tipid=database_specific_tokens</wfw:commentRss>
    <link>http://feedproxy.google.com/~r/dotNetTipOfTheDay/~3/OQuXnzezNNc/database_specific_tokens.aspx</link><feedburner:origLink>http://dotnettipoftheday.org/tips/database_specific_tokens.aspx</feedburner:origLink></item>
  </channel>
</rss>

