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

<channel>
	<title>Sheldon&#039;s Space</title>
	<atom:link href="http://sheldons.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://sheldons.wordpress.com</link>
	<description>The e-Brain of a Geek</description>
	<lastBuildDate>Tue, 31 Jan 2012 16:14:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='sheldons.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Sheldon&#039;s Space</title>
		<link>http://sheldons.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://sheldons.wordpress.com/osd.xml" title="Sheldon&#039;s Space" />
	<atom:link rel='hub' href='http://sheldons.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Custom Validation Controls</title>
		<link>http://sheldons.wordpress.com/2012/01/31/custom-validation-controls/</link>
		<comments>http://sheldons.wordpress.com/2012/01/31/custom-validation-controls/#comments</comments>
		<pubDate>Tue, 31 Jan 2012 16:12:43 +0000</pubDate>
		<dc:creator>SheldonS</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[.Net]]></category>
		<category><![CDATA[Validation]]></category>

		<guid isPermaLink="false">http://sheldons.wordpress.com/?p=162</guid>
		<description><![CDATA[Custom validation controls are a nice tool that you can use when the standard validation controls just won&#8217;t do the job.  Most examples I found out there only addressed the server side validation aspect.  Don&#8217;t get me wrong, you can do that, just use server side, but ideally you want to do both. Trust me though, if [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sheldons.wordpress.com&amp;blog=16314082&amp;post=162&amp;subd=sheldons&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Custom validation controls are a nice tool that you can use when the standard validation controls just won&#8217;t do the job.  Most examples I found out there only addressed the server side validation aspect.  Don&#8217;t get me wrong, you can do that, just use server side, but ideally you want to do both.</p>
<p>Trust me though, if you only want to do one side, do server side.  You will want to always do server side as a minimum just in case the user has javascript disabled or something.  Server side only is kind of old school but it gets the job done very reliably.</p>
<p>O.K.  On to my example.  I have a web form and lets say I have a field that I want to make sure is a Float so I can save it into my database.  It is nothing special, just a text box.  Also for this, lets pretend I already have a required field validator in place.  I always use those for fields I require, although you probably could set it to validate empty text, I just always use required field validators for required fields.</p>
<p><pre class="brush: xml;">
&lt;asp:TextBox ID=&quot;txtMyFloat&quot; runat=&quot;server&quot; Text=&quot;&quot; /&gt;
</pre></p>
<p>Next we need to create the methods to do our validation.  First the easy one, the code behind.  We are going to call this method cv_ValidFloat.</p>
<p><pre class="brush: csharp;">
protected void cv_ValidFloat(object sender, ServerValidateEventArgs e)
{
    bool bValid = false;
    try
    {
        float fCheck = float.Parse(e.Value);
        bValid = true;
    }
    catch (Exception ex)
    {
        ex = null;
        bValid = false;
    }
    finally
    {
        e.IsValid = bValid;
    }
}
</pre></p>
<p>Now that we have that, lets create our client side function in javascript.</p>
<p><pre class="brush: jscript;">
function ValidFloat(sender, args) {
    var vParse = parseFloat(args.Value);
    args.IsValid = !isNaN(vParse);
}
</pre></p>
<p>You see we still have our familiar sender and args variables. You can use the args just like you normally do in the code behind, mainly to get the Value and set the IsValid. So lets see what our custom validation control looks like.</p>
<p><pre class="brush: xml;">
&lt;asp:CustomValidator ID=&quot;valcMyFloat&quot; runat=&quot;server&quot; ControlToValidate=&quot;txtMyFloat&quot;
    Text=&quot;*&quot; ErrorMessage=&quot;Your Float entry does not appear valid.&quot; SetFocusOnError=&quot;true&quot;
    Display=&quot;Dynamic&quot; ClientValidationFunction=&quot;ValidFloat&quot; OnServerValidate=&quot;cv_ValidFloat&quot;
    ValidateEmptyText=&quot;false&quot; EnableClientScript=&quot;true&quot;&gt;
&lt;/asp:CustomValidator&gt;
</pre></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sheldons.wordpress.com/162/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sheldons.wordpress.com/162/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sheldons.wordpress.com/162/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sheldons.wordpress.com/162/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sheldons.wordpress.com/162/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sheldons.wordpress.com/162/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sheldons.wordpress.com/162/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sheldons.wordpress.com/162/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sheldons.wordpress.com/162/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sheldons.wordpress.com/162/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sheldons.wordpress.com/162/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sheldons.wordpress.com/162/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sheldons.wordpress.com/162/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sheldons.wordpress.com/162/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sheldons.wordpress.com&amp;blog=16314082&amp;post=162&amp;subd=sheldons&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sheldons.wordpress.com/2012/01/31/custom-validation-controls/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a81efb47d8ef22151a85e5488d203ccc?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sheldons</media:title>
		</media:content>
	</item>
		<item>
		<title>Encrypt That ViewState!</title>
		<link>http://sheldons.wordpress.com/2012/01/11/encrypt-that-viewstate/</link>
		<comments>http://sheldons.wordpress.com/2012/01/11/encrypt-that-viewstate/#comments</comments>
		<pubDate>Wed, 11 Jan 2012 20:16:58 +0000</pubDate>
		<dc:creator>SheldonS</dc:creator>
				<category><![CDATA[.NET]]></category>

		<guid isPermaLink="false">http://sheldons.wordpress.com/?p=156</guid>
		<description><![CDATA[Something that is probably over looked from time to time unless you are just always that secure is encrypting your ViewState.  While SSL may prevent some things you will may want to make it a bit harder for an end user to see the information stored in ViewState. Luckily this is very simple.  You can [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sheldons.wordpress.com&amp;blog=16314082&amp;post=156&amp;subd=sheldons&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Something that is probably over looked from time to time unless you are just always that secure is encrypting your ViewState.  While SSL may prevent some things you will may want to make it a bit harder for an end user to see the information stored in ViewState.</p>
<p>Luckily this is<a href="http://msdn.microsoft.com/en-us/library/system.web.ui.page.viewstateencryptionmode.aspx" target="_blank"> very simple</a>.  You can set it in the @Page directive (&lt;%@ Page Language=&#8221;C#&#8221; ViewStateEncryptionMode=&#8221;Always&#8221; %&gt;) or in the web.config file (&lt;pages viewStateEncryptionMode=&#8221;Always&#8221; /&gt;).</p>
<p>Of course, like many things .NET there are many ways to do this depending on your specific situation.  For that amount of detail you should read the <a href="http://msdn.microsoft.com/en-us/library/bb386448.aspx" target="_blank">ViewState Overview</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sheldons.wordpress.com/156/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sheldons.wordpress.com/156/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sheldons.wordpress.com/156/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sheldons.wordpress.com/156/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sheldons.wordpress.com/156/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sheldons.wordpress.com/156/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sheldons.wordpress.com/156/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sheldons.wordpress.com/156/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sheldons.wordpress.com/156/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sheldons.wordpress.com/156/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sheldons.wordpress.com/156/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sheldons.wordpress.com/156/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sheldons.wordpress.com/156/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sheldons.wordpress.com/156/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sheldons.wordpress.com&amp;blog=16314082&amp;post=156&amp;subd=sheldons&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sheldons.wordpress.com/2012/01/11/encrypt-that-viewstate/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a81efb47d8ef22151a85e5488d203ccc?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sheldons</media:title>
		</media:content>
	</item>
		<item>
		<title>WCF Over SSL</title>
		<link>http://sheldons.wordpress.com/2011/10/25/wcf-over-ssl/</link>
		<comments>http://sheldons.wordpress.com/2011/10/25/wcf-over-ssl/#comments</comments>
		<pubDate>Tue, 25 Oct 2011 17:40:40 +0000</pubDate>
		<dc:creator>SheldonS</dc:creator>
				<category><![CDATA[WCF]]></category>

		<guid isPermaLink="false">http://sheldons.wordpress.com/?p=145</guid>
		<description><![CDATA[While this seems like it would be a simple task, there are a few minor things you need to do to get things going.  I will not go into all of the various details, there are plenty of walk throughs out there to do that.  I am going to focus specifically on the web.config settings. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sheldons.wordpress.com&amp;blog=16314082&amp;post=145&amp;subd=sheldons&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>While this seems like it would be a simple task, there are a few minor things you need to do to get things going.  I will not go into all of the various details, there are plenty of walk throughs out there to do that.  I am going to focus specifically on the web.config settings.  For me this is where my trouble lived.</p>
<p>I created a very simple WCF.  It has the interface named IService and the svc named Service.  It consisted of several methods to add, subtract, and divide.  Like I said, it was very simple.  It ran great on non-SSL, but then I went to SSL and the trouble started.</p>
<p>I received this error message:</p>
<blockquote><p>Service &#8216;WCFTest.Service&#8217; has zero application (non-infrastructure) endpoints. This might be because no configuration file was found for your application, or because no service element matching the service name could be found in the configuration file, or because no endpoints were defined in the service element.</p></blockquote>
<p>The fix was to properly setup the binding and behaviors, and most importantly the service name and contract.  In my non-SSL version I named the service MyService and the contract pointed at IService.  In the end for the SSL one of the things I did was use the namespace and the service name for the service and the interface name for the contract.  I will put the web.config file below so you can take a look.  I will also include some links that helped me find my way.</p>
<p><pre class="brush: xml;">
&lt;?xml version=&quot;1.0&quot;?&gt;
&lt;configuration&gt;

  &lt;system.web&gt;
    &lt;compilation debug=&quot;true&quot; targetFramework=&quot;4.0&quot; /&gt;
      &lt;customErrors mode=&quot;Off&quot;&gt;&lt;/customErrors&gt;
  &lt;/system.web&gt;
  &lt;system.serviceModel&gt;
    &lt;services&gt;
        &lt;service name=&quot;WCFTest.IService&quot;&gt;
            &lt;endpoint address=&quot;&quot; binding=&quot;wsHttpBinding&quot; bindingConfiguration=&quot;sslBinding&quot; contract=&quot;WCFTest.IService&quot; /&gt;
            &lt;endpoint address=&quot;mex&quot; binding=&quot;mexHttpsBinding&quot; contract=&quot;IMetadataExchange&quot;/&gt;
        &lt;/service&gt;
    &lt;/services&gt;
    &lt;behaviors&gt;
        &lt;serviceBehaviors&gt;
            &lt;behavior&gt;
                &lt;serviceMetadata httpsGetEnabled=&quot;true&quot;/&gt;
                &lt;serviceDebug includeExceptionDetailInFaults=&quot;true&quot;/&gt;
            &lt;/behavior&gt;
        &lt;/serviceBehaviors&gt;
    &lt;/behaviors&gt;
      &lt;bindings&gt;
          &lt;wsHttpBinding&gt;
              &lt;binding name=&quot;sslBinding&quot;&gt;
                  &lt;security mode=&quot;Transport&quot;&gt;
                      &lt;transport clientCredentialType=&quot;None&quot; /&gt;
                  &lt;/security&gt;
              &lt;/binding&gt;
          &lt;/wsHttpBinding&gt;
      &lt;/bindings&gt;
    &lt;serviceHostingEnvironment multipleSiteBindingsEnabled=&quot;true&quot; /&gt;
  &lt;/system.serviceModel&gt;
 &lt;system.webServer&gt;
    &lt;modules runAllManagedModulesForAllRequests=&quot;true&quot;/&gt;
  &lt;/system.webServer&gt;

&lt;/configuration&gt;
</pre><br />
<a href="http://forums.asp.net/t/1733447.aspx/1">My post to ASP.NET Forums</a><br />
<a href="http://msdn.microsoft.com/en-us/netframework/dd939784">Beginner&#8217;s Guide to WCF</a></pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sheldons.wordpress.com/145/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sheldons.wordpress.com/145/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sheldons.wordpress.com/145/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sheldons.wordpress.com/145/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sheldons.wordpress.com/145/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sheldons.wordpress.com/145/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sheldons.wordpress.com/145/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sheldons.wordpress.com/145/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sheldons.wordpress.com/145/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sheldons.wordpress.com/145/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sheldons.wordpress.com/145/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sheldons.wordpress.com/145/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sheldons.wordpress.com/145/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sheldons.wordpress.com/145/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sheldons.wordpress.com&amp;blog=16314082&amp;post=145&amp;subd=sheldons&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sheldons.wordpress.com/2011/10/25/wcf-over-ssl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a81efb47d8ef22151a85e5488d203ccc?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sheldons</media:title>
		</media:content>
	</item>
		<item>
		<title>I Have Access &#8211; Team Foundation Service Preview</title>
		<link>http://sheldons.wordpress.com/2011/10/19/i-have-access-team-foundation-service-preview/</link>
		<comments>http://sheldons.wordpress.com/2011/10/19/i-have-access-team-foundation-service-preview/#comments</comments>
		<pubDate>Wed, 19 Oct 2011 15:22:49 +0000</pubDate>
		<dc:creator>SheldonS</dc:creator>
				<category><![CDATA[Team Foundation Server]]></category>

		<guid isPermaLink="false">http://sheldons.wordpress.com/?p=143</guid>
		<description><![CDATA[Yesterday I received an email for the Team Foundation Service Preview!  I am so excited to start playing with this product.  I have added a couple of friends as team members and asked coworkers if they would like to help test it. My thinking is to have us test creating projects that use the Northwind [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sheldons.wordpress.com&amp;blog=16314082&amp;post=143&amp;subd=sheldons&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Yesterday I received an email for the Team Foundation Service Preview!  I am so excited to start playing with this product.  I have added a couple of friends as team members and asked coworkers if they would like to help test it.</p>
<p>My thinking is to have us test creating projects that use the Northwind sample database.  At this time I cannot do much.  My personal machine is at home, and to connect you need at least a hotfix as long as you have VS2010 SP1.  I will update more as I do more.</p>
<p>So far&#8230;  Not bad.  I would like an easier interface to add new team members, but that could be a lack of familiarity on my part.  I am also using Chrome to access it.</p>
<p>For more information on what I am talking about, go read <a href="http://blogs.msdn.com/b/visualstudioalm/archive/2011/09/14/learning-about-team-foundation-service-preview.aspx" target="_blank">Learning About the Team Foundation Service Preview</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sheldons.wordpress.com/143/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sheldons.wordpress.com/143/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sheldons.wordpress.com/143/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sheldons.wordpress.com/143/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sheldons.wordpress.com/143/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sheldons.wordpress.com/143/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sheldons.wordpress.com/143/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sheldons.wordpress.com/143/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sheldons.wordpress.com/143/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sheldons.wordpress.com/143/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sheldons.wordpress.com/143/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sheldons.wordpress.com/143/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sheldons.wordpress.com/143/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sheldons.wordpress.com/143/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sheldons.wordpress.com&amp;blog=16314082&amp;post=143&amp;subd=sheldons&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sheldons.wordpress.com/2011/10/19/i-have-access-team-foundation-service-preview/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a81efb47d8ef22151a85e5488d203ccc?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sheldons</media:title>
		</media:content>
	</item>
		<item>
		<title>Implementing IDisposable</title>
		<link>http://sheldons.wordpress.com/2011/10/12/implementing-idisposable/</link>
		<comments>http://sheldons.wordpress.com/2011/10/12/implementing-idisposable/#comments</comments>
		<pubDate>Wed, 12 Oct 2011 16:47:54 +0000</pubDate>
		<dc:creator>SheldonS</dc:creator>
				<category><![CDATA[C#]]></category>

		<guid isPermaLink="false">http://sheldons.wordpress.com/?p=139</guid>
		<description><![CDATA[Here is something I tend to forget from time to time.  How to impliment IDisposable for a class.  While there are many places to find this, I tend to go to my blog first, because usually I will put something in here for what I need. When declaring you class you need to have it [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sheldons.wordpress.com&amp;blog=16314082&amp;post=139&amp;subd=sheldons&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Here is something I tend to forget from time to time.  How to impliment IDisposable for a class.  While there are many places to find this, I tend to go to my blog first, because usually I will put something in here for what I need.</p>
<p>When declaring you class you need to have it inherit the IDisposable class.</p>
<p><pre class="brush: csharp;">
public class MyClass : IDisposable
</pre></p>
<p>After that, somewhere in your class you need to implement the methods.</p>
<p><pre class="brush: csharp;">
#region IDisposable Methods
        //Implement IDisposable.
        public void Dispose()
        {
            Dispose(true);
            GC.SuppressFinalize(this);
        }
        //This is where you will do the cleaning
        protected virtual void Dispose(bool disposing)
        {
            if (disposing)
            {
                // Free other state (managed objects).
            }
            // Free your own state (unmanaged objects).
            // Set large fields to null.
        }

        //MSDN says you can leave the finalizer out if
        //the class does not own unmanaged resources.
        ~MyClass()
        {
            // Simply call Dispose(false).
            Dispose(false);
        }
#endregion// IDisposable Methods
</pre></p>
<p>For more information you can see the <a href="http://msdn.microsoft.com/en-US/library/ms244737(v=VS.100).aspx" target="_blank">article on MSDN</a>.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sheldons.wordpress.com/139/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sheldons.wordpress.com/139/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sheldons.wordpress.com/139/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sheldons.wordpress.com/139/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sheldons.wordpress.com/139/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sheldons.wordpress.com/139/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sheldons.wordpress.com/139/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sheldons.wordpress.com/139/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sheldons.wordpress.com/139/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sheldons.wordpress.com/139/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sheldons.wordpress.com/139/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sheldons.wordpress.com/139/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sheldons.wordpress.com/139/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sheldons.wordpress.com/139/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sheldons.wordpress.com&amp;blog=16314082&amp;post=139&amp;subd=sheldons&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sheldons.wordpress.com/2011/10/12/implementing-idisposable/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a81efb47d8ef22151a85e5488d203ccc?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sheldons</media:title>
		</media:content>
	</item>
		<item>
		<title>Format A Databound Control In A GridView</title>
		<link>http://sheldons.wordpress.com/2011/09/01/format-a-databound-control-in-a-gridview/</link>
		<comments>http://sheldons.wordpress.com/2011/09/01/format-a-databound-control-in-a-gridview/#comments</comments>
		<pubDate>Thu, 01 Sep 2011 15:36:44 +0000</pubDate>
		<dc:creator>SheldonS</dc:creator>
				<category><![CDATA[Bits]]></category>

		<guid isPermaLink="false">http://sheldons.wordpress.com/?p=131</guid>
		<description><![CDATA[This is just a little bit that I keep forgetting for some reason.  Lets say I have a gridview, and in it I want to display the date.  Just the date, but I do not want to use the SQL method to format the date.  You just add the format string to the binding. This [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sheldons.wordpress.com&amp;blog=16314082&amp;post=131&amp;subd=sheldons&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This is just a little bit that I keep forgetting for some reason.  Lets say I have a gridview, and in it I want to display the date.  Just the date, but I do not want to use the SQL method to format the date.  You just add the format string to the binding.</p>
<p><pre class="brush: csharp;">

Text='&lt;%# Bind(&quot;myDate&quot;, &quot;{0:MM/dd/yyyy}&quot;) %&gt;'

</pre></p>
<p>This really would work with any kind of formatting that you needed to do.  I just felt that date would make an easier example.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sheldons.wordpress.com/131/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sheldons.wordpress.com/131/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sheldons.wordpress.com/131/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sheldons.wordpress.com/131/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sheldons.wordpress.com/131/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sheldons.wordpress.com/131/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sheldons.wordpress.com/131/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sheldons.wordpress.com/131/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sheldons.wordpress.com/131/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sheldons.wordpress.com/131/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sheldons.wordpress.com/131/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sheldons.wordpress.com/131/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sheldons.wordpress.com/131/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sheldons.wordpress.com/131/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sheldons.wordpress.com&amp;blog=16314082&amp;post=131&amp;subd=sheldons&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sheldons.wordpress.com/2011/09/01/format-a-databound-control-in-a-gridview/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a81efb47d8ef22151a85e5488d203ccc?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sheldons</media:title>
		</media:content>
	</item>
		<item>
		<title>Model-First in the Entity Framework</title>
		<link>http://sheldons.wordpress.com/2011/08/30/model-first-in-the-entity-framework/</link>
		<comments>http://sheldons.wordpress.com/2011/08/30/model-first-in-the-entity-framework/#comments</comments>
		<pubDate>Tue, 30 Aug 2011 13:53:42 +0000</pubDate>
		<dc:creator>SheldonS</dc:creator>
				<category><![CDATA[Entity Framework]]></category>

		<guid isPermaLink="false">http://sheldons.wordpress.com/?p=126</guid>
		<description><![CDATA[So I finally had the situation come up to do a model-first approach to Entity Framework (EF).  It was shockingly simple.  Normally I design my databases first and go from there, this time I did my EF model.  Now this was just a simple four entity deal but I thought it would be a great [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sheldons.wordpress.com&amp;blog=16314082&amp;post=126&amp;subd=sheldons&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>So I finally had the situation come up to do a model-first approach to Entity Framework (EF).  It was shockingly simple.  Normally I design my databases first and go from there, this time I did my EF model.  Now this was just a simple four entity deal but I thought it would be a great Hello Model-First.</p>
<p>You simply create your entities in the designer, adding properties and adjusting their properties.  You know, like indicating someNum is an int32 instead of the default string, if something can be null, default values and so on.  You also add your associations.  Then you generate database from model.  I did this by right clicking the design surface and clicking on Generate Database from Model&#8230;   This will create a SQL script that you can run against your database.  In my case I did create an empty database with a SQL user before hand that I used in my connection information for generating the database.</p>
<p>If you still think it is harder than that, you can read this great article by <a href="http://msdn.microsoft.com/en-us/data/ff830362" target="_blank">Microsoft</a>.  I wanted to look it up and make sure I did not leave something out and found that article.  I still suggest you look over the article.  It goes into much more detail than my short text, and they include screen shots.</p>
<p>One thing I did go back and do was change the name of that connection.  Visual Studio named it MyPartModelObjectContainer (or something close to that), where MyPart was basically what I named the Model.  This was simple to do as well.  You rename it int eh connectionString area of your web.config and in the properties of the model.edmx file.  You can see its properties by just clicking on the design surface, not an entity or anything, just on the empty space.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sheldons.wordpress.com/126/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sheldons.wordpress.com/126/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sheldons.wordpress.com/126/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sheldons.wordpress.com/126/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sheldons.wordpress.com/126/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sheldons.wordpress.com/126/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sheldons.wordpress.com/126/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sheldons.wordpress.com/126/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sheldons.wordpress.com/126/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sheldons.wordpress.com/126/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sheldons.wordpress.com/126/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sheldons.wordpress.com/126/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sheldons.wordpress.com/126/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sheldons.wordpress.com/126/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sheldons.wordpress.com&amp;blog=16314082&amp;post=126&amp;subd=sheldons&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sheldons.wordpress.com/2011/08/30/model-first-in-the-entity-framework/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a81efb47d8ef22151a85e5488d203ccc?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sheldons</media:title>
		</media:content>
	</item>
		<item>
		<title>Entity Framework 4 Quickstart</title>
		<link>http://sheldons.wordpress.com/2011/08/19/entity-framework-4-quickstart/</link>
		<comments>http://sheldons.wordpress.com/2011/08/19/entity-framework-4-quickstart/#comments</comments>
		<pubDate>Fri, 19 Aug 2011 13:33:42 +0000</pubDate>
		<dc:creator>SheldonS</dc:creator>
				<category><![CDATA[Entity Framework]]></category>
		<category><![CDATA[Learning]]></category>

		<guid isPermaLink="false">http://sheldons.wordpress.com/?p=123</guid>
		<description><![CDATA[Wanting to get started with Entity Framework 4?  Microsoft has a nice simple quickstart for it.  I am thinking of writing my won series of posts for using Entity Framework 4 for the practical developer. http://msdn.microsoft.com/en-us/library/bb399182.aspx<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sheldons.wordpress.com&amp;blog=16314082&amp;post=123&amp;subd=sheldons&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Wanting to get started with Entity Framework 4?  Microsoft has a nice simple quickstart for it.  I am thinking of writing my won series of posts for using Entity Framework 4 for the practical developer.</p>
<p><a href="http://msdn.microsoft.com/en-us/library/bb399182.aspx" target="_blank">http://msdn.microsoft.com/en-us/library/bb399182.aspx</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sheldons.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sheldons.wordpress.com/123/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sheldons.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sheldons.wordpress.com/123/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sheldons.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sheldons.wordpress.com/123/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sheldons.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sheldons.wordpress.com/123/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sheldons.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sheldons.wordpress.com/123/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sheldons.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sheldons.wordpress.com/123/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sheldons.wordpress.com/123/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sheldons.wordpress.com/123/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sheldons.wordpress.com&amp;blog=16314082&amp;post=123&amp;subd=sheldons&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sheldons.wordpress.com/2011/08/19/entity-framework-4-quickstart/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a81efb47d8ef22151a85e5488d203ccc?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sheldons</media:title>
		</media:content>
	</item>
		<item>
		<title>Odd IIS Error &#8211; Entity Too Large</title>
		<link>http://sheldons.wordpress.com/2011/08/04/odd-iis-error-entity-too-large/</link>
		<comments>http://sheldons.wordpress.com/2011/08/04/odd-iis-error-entity-too-large/#comments</comments>
		<pubDate>Thu, 04 Aug 2011 19:02:23 +0000</pubDate>
		<dc:creator>SheldonS</dc:creator>
				<category><![CDATA[Bits]]></category>
		<category><![CDATA[IIS]]></category>

		<guid isPermaLink="false">http://sheldons.wordpress.com/?p=119</guid>
		<description><![CDATA[I ran into this error today with users uploading images as part of a webform over https. I did some searching and found a few links that I will list below. Basically all of these suggested increasing the UploadReadAheadSize in ApplicaitonHost.config. http://forums.iis.net/t/1169257.aspx http://blogs.msdn.com/b/jiruss/archive/2007/04/13/http-413-request-entity-too-large-can-t-upload-large-files-using-iis6.aspx http://www.iis.net/ConfigReference/system.webServer/security/requestFiltering/requestLimits<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sheldons.wordpress.com&amp;blog=16314082&amp;post=119&amp;subd=sheldons&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I ran into this error today with users uploading images as part of a webform over https. I did some searching and found a few links that I will list below. Basically all of these suggested increasing the UploadReadAheadSize in ApplicaitonHost.config.</p>
<p><a href="http://forums.iis.net/t/1169257.aspx" target="_blank">http://forums.iis.net/t/1169257.aspx</a></p>
<p><a href="http://blogs.msdn.com/b/jiruss/archive/2007/04/13/http-413-request-entity-too-large-can-t-upload-large-files-using-iis6.aspx" target="_blank">http://blogs.msdn.com/b/jiruss/archive/2007/04/13/http-413-request-entity-too-large-can-t-upload-large-files-using-iis6.aspx</a></p>
<p><a href="http://www.iis.net/ConfigReference/system.webServer/security/requestFiltering/requestLimits" target="_blank">http://www.iis.net/ConfigReference/system.webServer/security/requestFiltering/requestLimits</a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sheldons.wordpress.com/119/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sheldons.wordpress.com/119/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sheldons.wordpress.com/119/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sheldons.wordpress.com/119/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sheldons.wordpress.com/119/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sheldons.wordpress.com/119/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sheldons.wordpress.com/119/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sheldons.wordpress.com/119/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sheldons.wordpress.com/119/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sheldons.wordpress.com/119/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sheldons.wordpress.com/119/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sheldons.wordpress.com/119/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sheldons.wordpress.com/119/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sheldons.wordpress.com/119/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sheldons.wordpress.com&amp;blog=16314082&amp;post=119&amp;subd=sheldons&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sheldons.wordpress.com/2011/08/04/odd-iis-error-entity-too-large/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a81efb47d8ef22151a85e5488d203ccc?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sheldons</media:title>
		</media:content>
	</item>
		<item>
		<title>SQL Server Date Formats</title>
		<link>http://sheldons.wordpress.com/2011/07/07/sql-server-date-formats/</link>
		<comments>http://sheldons.wordpress.com/2011/07/07/sql-server-date-formats/#comments</comments>
		<pubDate>Thu, 07 Jul 2011 15:45:52 +0000</pubDate>
		<dc:creator>SheldonS</dc:creator>
				<category><![CDATA[SQL]]></category>

		<guid isPermaLink="false">http://sheldons.wordpress.com/?p=112</guid>
		<description><![CDATA[I found this information several years ago and saved it to a wiki at work.  I thought I would put it out here to share with others and for me to access when away from the office. I must apologize for not remembering where I found this information. Date Formats Date Formats SQL Server Date [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sheldons.wordpress.com&amp;blog=16314082&amp;post=112&amp;subd=sheldons&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I found this information several years ago and saved it to a wiki at work.  I thought I would put it out here to share with others and for me to access when away from the office.</p>
<p>I must apologize for not remembering where I found this information.</p>
<table class="bodytext" cellspacing="0" cellpadding="0" width="100%" border="0">
<tr>
<td valign="top" bgcolor="#ebffed" style="border:#669900 thin solid;">
<table class="bodytext" cellspacing="0" cellpadding="0" width="100%" border="0">
<tr>
<td style="padding:10px;">
                                        <b>Date Formats</b>
                                    </td>
</tr>
</table>
<table class="bodytext" cellspacing="1" cellpadding="1" width="100%" bgcolor="#ebffed" border="0">
<tr>
<td style="padding-left:10px;font-weight:bold;font-size:14px;color:#ffffff;" bgcolor="#669900">
                                        Date Formats
                                    </td>
</tr>
<tr>
<td style="padding:10px;">
<table class="bodytext" border="0" cellpadding="3" cellspacing="0" width="100%">
<tr valign="top">
<td>
</td>
<td style="padding-left:10px;">
<p class="headertitle" style="color:#669900;font-weight:bold;">
                                                        SQL Server Date Formats</p>
<p>
                                                        One of the most frequently asked questions in SQL Server forums is how to format<br />
                                                        a datetime value or column into a specific date format.&nbsp; Here&#8217;s a summary of<br />
                                                        the different date formats that come standard in SQL Server as part of the <b>CONVERT</b><br />
                                                        function.&nbsp; Following the standard date formats are some extended date formats<br />
                                                        that are often asked by SQL Server developers.</p>
<p>
                                                        It is worth to note that the output of these date formats are of VARCHAR data types<br />
                                                        already and not of <b>DATETIME</b> data type.&nbsp; With this in mind, any date<br />
                                                        comparisons performed after the datetime value has been formatted are using the<br />
                                                        VARCHAR value of the date and time and not its original <b>DATETIME</b> value.</p>
</td>
</tr>
</table>
<table class="bodytext" style="font-size:10px;" cellspacing="0" cellpadding="3" border="1">
<tr style="font-weight:bold;color:#FFFFFF;" align="center" bgcolor="#669900">
<td colspan="4">
                                                    Standard Date Formats
                                                </td>
</tr>
<tr style="font-weight:bold;" align="center" bgcolor="#CCFF99">
<td>
                                                    Date Format
                                                </td>
<td>
                                                    Standard
                                                </td>
<td>
                                                    SQL Statement
                                                </td>
<td>
                                                    Sample Output
                                                </td>
</tr>
<tr>
<td align="center">
                                                    Mon DD YYYY <sup>1</sup><br />
                                                    HH:MIAM (or PM)
                                                </td>
<td align="center">
                                                    Default
                                                </td>
<td>
                                                    SELECT CONVERT(VARCHAR(20), GETDATE(), 100)
                                                </td>
<td align="center">
                                                    Jan 1 2005 1:29PM <sup>1</sup>
                                                </td>
</tr>
<tr>
<td align="center">
                                                    MM/DD/YY
                                                </td>
<td align="center">
                                                    USA
                                                </td>
<td>
                                                    SELECT CONVERT(VARCHAR(8), GETDATE(), 1) AS [MM/DD/YY]
                                                </td>
<td align="center">
                                                    11/23/98
                                                </td>
</tr>
<tr>
<td align="center">
                                                    MM/DD/YYYY
                                                </td>
<td align="center">
                                                    USA
                                                </td>
<td>
                                                    SELECT CONVERT(VARCHAR(10), GETDATE(), 101) AS [MM/DD/YYYY]
                                                </td>
<td align="center">
                                                    11/23/1998
                                                </td>
</tr>
<tr>
<td align="center">
                                                    YY.MM.DD
                                                </td>
<td align="center">
                                                    ANSI
                                                </td>
<td>
                                                    SELECT CONVERT(VARCHAR(8), GETDATE(), 2) AS [YY.MM.DD]
                                                </td>
<td align="center">
                                                    72.01.01
                                                </td>
</tr>
<tr>
<td align="center">
                                                    YYYY.MM.DD
                                                </td>
<td align="center">
                                                    ANSI
                                                </td>
<td>
                                                    SELECT CONVERT(VARCHAR(10), GETDATE(), 102) AS [YYYY.MM.DD]
                                                </td>
<td align="center">
                                                    1972.01.01
                                                </td>
</tr>
<tr>
<td align="center">
                                                    DD/MM/YY
                                                </td>
<td align="center">
                                                    British/French
                                                </td>
<td>
                                                    SELECT CONVERT(VARCHAR(8), GETDATE(), 3) AS [DD/MM/YY]
                                                </td>
<td align="center">
                                                    19/02/72
                                                </td>
</tr>
<tr>
<td align="center">
                                                    DD/MM/YYYY
                                                </td>
<td align="center">
                                                    British/French
                                                </td>
<td>
                                                    SELECT CONVERT(VARCHAR(10), GETDATE(), 103) AS [DD/MM/YYYY]
                                                </td>
<td align="center">
                                                    19/02/1972
                                                </td>
</tr>
<tr>
<td align="center">
                                                    DD.MM.YY
                                                </td>
<td align="center">
                                                    German
                                                </td>
<td>
                                                    SELECT CONVERT(VARCHAR(8), GETDATE(), 4) AS [DD.MM.YY]
                                                </td>
<td align="center">
                                                    25.12.05
                                                </td>
</tr>
<tr>
<td align="center">
                                                    DD.MM.YYYY
                                                </td>
<td align="center">
                                                    German
                                                </td>
<td>
                                                    SELECT CONVERT(VARCHAR(10), GETDATE(), 104) AS [DD.MM.YYYY]
                                                </td>
<td align="center">
                                                    25.12.2005
                                                </td>
</tr>
<tr>
<td align="center">
                                                    DD-MM-YY
                                                </td>
<td align="center">
                                                    Italian
                                                </td>
<td>
                                                    SELECT CONVERT(VARCHAR(8), GETDATE(), 5) AS [DD-MM-YY]
                                                </td>
<td align="center">
                                                    24-01-98
                                                </td>
</tr>
<tr>
<td align="center">
                                                    DD-MM-YYYY
                                                </td>
<td align="center">
                                                    Italian
                                                </td>
<td>
                                                    SELECT CONVERT(VARCHAR(10), GETDATE(), 105) AS [DD-MM-YYYY]
                                                </td>
<td align="center">
                                                    24-01-1998
                                                </td>
</tr>
<tr>
<td align="center">
                                                    DD Mon YY <sup>1</sup>
                                                </td>
<td align="center">
                                                    -
                                                </td>
<td>
                                                    SELECT CONVERT(VARCHAR(9), GETDATE(), 6) AS [DD MON YY]
                                                </td>
<td align="center">
                                                    04 Jul 06 <sup>1</sup>
                                                </td>
</tr>
<tr>
<td align="center">
                                                    DD Mon YYYY <sup>1</sup>
                                                </td>
<td align="center">
                                                    -
                                                </td>
<td>
                                                    SELECT CONVERT(VARCHAR(11), GETDATE(), 106) AS [DD MON YYYY]
                                                </td>
<td align="center">
                                                    04 Jul 2006 <sup>1</sup>
                                                </td>
</tr>
<tr>
<td align="center">
                                                    Mon DD, YY <sup>1</sup>
                                                </td>
<td align="center">
                                                    -
                                                </td>
<td>
                                                    SELECT CONVERT(VARCHAR(10), GETDATE(), 7) AS [Mon DD, YY]
                                                </td>
<td align="center">
                                                    Jan 24, 98 <sup>1</sup>
                                                </td>
</tr>
<tr>
<td align="center">
                                                    Mon DD, YYYY <sup>1</sup>
                                                </td>
<td align="center">
                                                    -
                                                </td>
<td>
                                                    SELECT CONVERT(VARCHAR(12), GETDATE(), 107) AS [Mon DD, YYYY]
                                                </td>
<td align="center">
                                                    Jan 24, 1998 <sup>1</sup>
                                                </td>
</tr>
<tr>
<td align="center">
                                                    HH:MM:SS
                                                </td>
<td align="center">
                                                    -
                                                </td>
<td>
                                                    SELECT CONVERT(VARCHAR(8), GETDATE(), 108)
                                                </td>
<td align="center">
                                                    03:24:53
                                                </td>
</tr>
<tr>
<td align="center">
                                                    Mon DD YYYY HH:MI:SS:MMMAM (or PM) <sup>1</sup>
                                                </td>
<td align="center">
                                                    Default +<br />
                                                    <br />
                                                    milliseconds
                                                </td>
<td>
                                                    SELECT CONVERT(VARCHAR(26), GETDATE(), 109)
                                                </td>
<td align="center">
                                                    Apr 28 2006 12:32:29:253PM <sup>1</sup>
                                                </td>
</tr>
<tr>
<td align="center">
                                                    MM-DD-YY
                                                </td>
<td align="center">
                                                    USA
                                                </td>
<td>
                                                    SELECT CONVERT(VARCHAR(8), GETDATE(), 10) AS [MM-DD-YY]
                                                </td>
<td align="center">
                                                    01-01-06
                                                </td>
</tr>
<tr>
<td align="center">
                                                    MM-DD-YYYY
                                                </td>
<td align="center">
                                                    USA
                                                </td>
<td>
                                                    SELECT CONVERT(VARCHAR(10), GETDATE(), 110) AS [MM-DD-YYYY]
                                                </td>
<td align="center">
                                                    01-01-2006
                                                </td>
</tr>
<tr>
<td align="center">
                                                    YY/MM/DD
                                                </td>
<td align="center">
                                                    -
                                                </td>
<td>
                                                    SELECT CONVERT(VARCHAR(8), GETDATE(), 11) AS [YY/MM/DD]
                                                </td>
<td align="center">
                                                    98/11/23
                                                </td>
</tr>
<tr>
<td align="center">
                                                    YYYY/MM/DD
                                                </td>
<td align="center">
                                                    -
                                                </td>
<td>
                                                    SELECT CONVERT(VARCHAR(10), GETDATE(), 111) AS [YYYY/MM/DD]
                                                </td>
<td align="center">
                                                    1998/11/23
                                                </td>
</tr>
<tr>
<td align="center">
                                                    YYMMDD
                                                </td>
<td align="center">
                                                    ISO
                                                </td>
<td>
                                                    SELECT CONVERT(VARCHAR(6), GETDATE(), 12) AS [YYMMDD]
                                                </td>
<td align="center">
                                                    980124
                                                </td>
</tr>
<tr>
<td align="center">
                                                    YYYYMMDD
                                                </td>
<td align="center">
                                                    ISO
                                                </td>
<td>
                                                    SELECT CONVERT(VARCHAR(8), GETDATE(), 112) AS [YYYYMMDD]
                                                </td>
<td align="center">
                                                    19980124
                                                </td>
</tr>
<tr>
<td align="center">
                                                    DD Mon YYYY HH:MM:SS:MMM(24h) <sup>1</sup>
                                                </td>
<td align="center">
                                                    Europe default + milliseconds
                                                </td>
<td>
                                                    SELECT CONVERT(VARCHAR(24), GETDATE(), 113)
                                                </td>
<td align="center">
                                                    28 Apr 2006 00:34:55:190 <sup>1</sup>
                                                </td>
</tr>
<tr>
<td align="center">
                                                    HH:MI:SS:MMM(24H)
                                                </td>
<td align="center">
                                                    -
                                                </td>
<td>
                                                    SELECT CONVERT(VARCHAR(12), GETDATE(), 114) AS [HH:MI:SS:MMM(24H)]
                                                </td>
<td align="center">
                                                    11:34:23:013
                                                </td>
</tr>
<tr>
<td align="center">
                                                    YYYY-MM-DD HH:MI:SS(24h)
                                                </td>
<td align="center">
                                                    ODBC Canonical
                                                </td>
<td>
                                                    SELECT CONVERT(VARCHAR(19), GETDATE(), 120)
                                                </td>
<td align="center">
                                                    1972-01-01 13:42:24
                                                </td>
</tr>
<tr>
<td align="center">
                                                    YYYY-MM-DD HH:MI:SS.MMM(24h)
                                                </td>
<td align="center">
                                                    ODBC Canonical<br />
                                                    (with milliseconds)
                                                </td>
<td>
                                                    SELECT CONVERT(VARCHAR(23), GETDATE(), 121)
                                                </td>
<td align="center">
                                                    1972-02-19 06:35:24.489
                                                </td>
</tr>
<tr>
<td align="center">
                                                    YYYY-MM-DDTHH:MM:SS:MMM
                                                </td>
<td align="center">
                                                    ISO8601
                                                </td>
<td>
                                                    SELECT CONVERT(VARCHAR(23), GETDATE(), 126)
                                                </td>
<td align="center">
                                                    1998-11-23T11:25:43:250
                                                </td>
</tr>
<tr>
<td align="center">
                                                    DD Mon YYYY HH:MI:SS:MMMAM <sup>1</sup>
                                                </td>
<td align="center">
                                                    Kuwaiti
                                                </td>
<td>
                                                    SELECT CONVERT(VARCHAR(26), GETDATE(), 130)
                                                </td>
<td align="center">
                                                    28 Apr 2006 12:39:32:429AM <sup>1</sup>
                                                </td>
</tr>
<tr>
<td align="center">
                                                    DD/MM/YYYY HH:MI:SS:MMMAM
                                                </td>
<td align="center">
                                                    Kuwaiti
                                                </td>
<td>
                                                    SELECT CONVERT(VARCHAR(25), GETDATE(), 131)
                                                </td>
<td align="center">
                                                    28/04/2006 12:39:32:429AM
                                                </td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="left" style="padding-left:10px;">
</td>
</tr>
<tr>
<td style="padding:10px;">
<p>
                                            Here are some more date formats that does not come standard in SQL Server as part<br />
                                            of the <b>CONVERT</b> function.</p>
<table class="bodytext" style="font-size:10px;" cellspacing="0" cellpadding="3" border="1">
<tr style="font-weight:bold;color:#FFFFFF;" align="center" bgcolor="#669900">
<td colspan="3">
                                                    Extended Date Formats
                                                </td>
</tr>
<tr style="font-weight:bold;" align="center" bgcolor="#CCFF99">
<td>
                                                    Date Format
                                                </td>
<td>
                                                    SQL Statement
                                                </td>
<td>
                                                    Sample Output
                                                </td>
</tr>
<tr>
<td align="center">
                                                    YY-MM-DD
                                                </td>
<td>
<div>
                                                        SELECT SUBSTRING(CONVERT(VARCHAR(10), GETDATE(), 120), 3, 8) AS [YY-MM-DD]</div>
<div>
                                                        SELECT REPLACE(CONVERT(VARCHAR(8), GETDATE(), 11), &#8216;/&#8217;, &#8216;-&#8217;) AS [YY-MM-DD]</div>
</td>
<td align="center">
                                                    99-01-24
                                                </td>
</tr>
<tr>
<td align="center">
                                                    YYYY-MM-DD
                                                </td>
<td>
<div>
                                                        SELECT CONVERT(VARCHAR(10), GETDATE(), 120) AS [YYYY-MM-DD]</div>
<div>
                                                        SELECT REPLACE(CONVERT(VARCHAR(10), GETDATE(), 111), &#8216;/&#8217;, &#8216;-&#8217;) AS [YYYY-MM-DD]</div>
</td>
<td align="center">
                                                    1999-01-24
                                                </td>
</tr>
<tr>
<td align="center">
                                                    MM/YY
                                                </td>
<td>
                                                    SELECT RIGHT(CONVERT(VARCHAR(8), GETDATE(), 3), 5) AS [MM/YY]<br />
                                                    SELECT SUBSTRING(CONVERT(VARCHAR(8), GETDATE(), 3), 4, 5) AS [MM/YY]
                                                </td>
<td align="center">
                                                    08/99
                                                </td>
</tr>
<tr>
<td align="center">
                                                    MM/YYYY
                                                </td>
<td>
                                                    SELECT RIGHT(CONVERT(VARCHAR(10), GETDATE(), 103), 7) AS [MM/YYYY]
                                                </td>
<td align="center">
                                                    12/2005
                                                </td>
</tr>
<tr>
<td align="center">
                                                    YY/MM
                                                </td>
<td>
                                                    SELECT CONVERT(VARCHAR(5), GETDATE(), 11) AS [YY/MM]
                                                </td>
<td align="center">
                                                    99/08
                                                </td>
</tr>
<tr>
<td style="height:23px;" align="center">
                                                    YYYY/MM
                                                </td>
<td style="height:23px;">
                                                    SELECT CONVERT(VARCHAR(7), GETDATE(), 111) AS [YYYY/MM]
                                                </td>
<td style="height:23px;" align="center">
                                                    2005/12
                                                </td>
</tr>
<tr>
<td align="center">
                                                    Month DD, YYYY <sup>1</sup>
                                                </td>
<td>
                                                    SELECT DATENAME(MM, GETDATE()) + RIGHT(CONVERT(VARCHAR(12), GETDATE(), 107), 9)<br />
                                                    AS [Month DD, YYYY]
                                                </td>
<td align="center">
                                                    July 04, 2006 <sup>1</sup>
                                                </td>
</tr>
<tr>
<td align="center">
                                                    Mon YYYY <sup>1</sup>
                                                </td>
<td>
                                                    SELECT SUBSTRING(CONVERT(VARCHAR(11), GETDATE(), 113), 4, 8) AS [Mon YYYY]
                                                </td>
<td align="center">
                                                    Apr 2006 <sup>1</sup>
                                                </td>
</tr>
<tr>
<td align="center">
                                                    Month YYYY <sup>1</sup>
                                                </td>
<td>
                                                    SELECT DATENAME(MM, GETDATE()) + &#8216; &#8216; + CAST(YEAR(GETDATE()) AS VARCHAR(4)) AS [Month<br />
                                                    YYYY]
                                                </td>
<td align="center">
                                                    February 2006 <sup>1</sup>
                                                </td>
</tr>
<tr>
<td align="center">
                                                    DD Month <sup>1</sup>
                                                </td>
<td>
                                                    SELECT CAST(DAY(GETDATE()) AS VARCHAR(2)) + &#8216; &#8216; + DATENAME(MM, GETDATE()) AS [DD<br />
                                                    Month]
                                                </td>
<td align="center">
                                                    11 September <sup>1</sup>
                                                </td>
</tr>
<tr>
<td align="center">
                                                    Month DD <sup>1</sup>
                                                </td>
<td>
                                                    SELECT DATENAME(MM, GETDATE()) + &#8216; &#8216; + CAST(DAY(GETDATE()) AS VARCHAR(2)) AS [Month<br />
                                                    DD]
                                                </td>
<td align="center">
                                                    September 11 <sup>1</sup>
                                                </td>
</tr>
<tr>
<td align="center">
                                                    DD Month YY <sup>1</sup>
                                                </td>
<td>
                                                    SELECT CAST(DAY(GETDATE()) AS VARCHAR(2)) + &#8216; &#8216; + DATENAME(MM, GETDATE()) + &#8216; &#8216;<br />
                                                    + RIGHT(CAST(YEAR(GETDATE()) AS VARCHAR(4)), 2) AS [DD Month YY]
                                                </td>
<td align="center">
                                                    19 February 72 <sup>1</sup>
                                                </td>
</tr>
<tr>
<td align="center">
                                                    DD Month YYYY <sup>1</sup>
                                                </td>
<td>
                                                    SELECT CAST(DAY(GETDATE()) AS VARCHAR(2)) + &#8216; &#8216; + DATENAME(MM, GETDATE()) + &#8216; &#8216;<br />
                                                    + CAST(YEAR(GETDATE()) AS VARCHAR(4)) AS [DD Month YYYY]
                                                </td>
<td align="center">
                                                    11 September 2002 <sup>1</sup>
                                                </td>
</tr>
<tr>
<td align="center">
                                                    MM-YY
                                                </td>
<td>
                                                    SELECT RIGHT(CONVERT(VARCHAR(8), GETDATE(), 5), 5) AS [MM-YY]<br />
                                                    SELECT SUBSTRING(CONVERT(VARCHAR(8), GETDATE(), 5), 4, 5) AS [MM-YY]
                                                </td>
<td align="center">
                                                    12/92
                                                </td>
</tr>
<tr>
<td align="center">
                                                    MM-YYYY
                                                </td>
<td>
                                                    SELECT RIGHT(CONVERT(VARCHAR(10), GETDATE(), 105), 7) AS [MM-YYYY]
                                                </td>
<td align="center">
                                                    05-2006
                                                </td>
</tr>
<tr>
<td align="center">
                                                    YY-MM
                                                </td>
<td>
                                                    SELECT RIGHT(CONVERT(VARCHAR(7), GETDATE(), 120), 5) AS [YY-MM]<br />
                                                    SELECT SUBSTRING(CONVERT(VARCHAR(10), GETDATE(), 120), 3, 5) AS [YY-MM]
                                                </td>
<td align="center">
                                                    92/12
                                                </td>
</tr>
<tr>
<td align="center">
                                                    YYYY-MM
                                                </td>
<td>
                                                    SELECT CONVERT(VARCHAR(7), GETDATE(), 120) AS [YYYY-MM]
                                                </td>
<td align="center">
                                                    2006-05
                                                </td>
</tr>
<tr>
<td align="center">
                                                    MMDDYY
                                                </td>
<td>
                                                    SELECT REPLACE(CONVERT(VARCHAR(10), GETDATE(), 1), &#8216;/&#8217;, &#8221;) AS [MMDDYY]
                                                </td>
<td align="center">
                                                    122506
                                                </td>
</tr>
<tr>
<td align="center">
                                                    MMDDYYYY
                                                </td>
<td>
                                                    SELECT REPLACE(CONVERT(VARCHAR(10), GETDATE(), 101), &#8216;/&#8217;, &#8221;) AS [MMDDYYYY]
                                                </td>
<td align="center">
                                                    12252006
                                                </td>
</tr>
<tr>
<td align="center">
                                                    DDMMYY
                                                </td>
<td>
                                                    SELECT REPLACE(CONVERT(VARCHAR(10), GETDATE(), 3), &#8216;/&#8217;, &#8221;) AS [DDMMYY]
                                                </td>
<td align="center">
                                                    240702
                                                </td>
</tr>
<tr>
<td align="center">
                                                    DDMMYYYY
                                                </td>
<td>
                                                    SELECT REPLACE(CONVERT(VARCHAR(10), GETDATE(), 103), &#8216;/&#8217;, &#8221;) AS [DDMMYYYY]
                                                </td>
<td align="center">
                                                    24072002
                                                </td>
</tr>
<tr>
<td align="center">
                                                    Mon-YY <sup>1</sup>
                                                </td>
<td>
                                                    SELECT REPLACE(RIGHT(CONVERT(VARCHAR(9), GETDATE(), 6), 6), &#8216; &#8216;, &#8216;-&#8217;) AS [Mon-YY]
                                                </td>
<td align="center">
                                                    Sep-02 <sup>1</sup>
                                                </td>
</tr>
<tr>
<td align="center">
                                                    Mon-YYYY <sup>1</sup>
                                                </td>
<td>
                                                    SELECT REPLACE(RIGHT(CONVERT(VARCHAR(11), GETDATE(), 106), 8), &#8216; &#8216;, &#8216;-&#8217;) AS [Mon-YYYY]
                                                </td>
<td align="center">
                                                    Sep-2002 <sup>1</sup>
                                                </td>
</tr>
<tr>
<td align="center">
                                                    DD-Mon-YY <sup>1</sup>
                                                </td>
<td>
                                                    SELECT REPLACE(CONVERT(VARCHAR(9), GETDATE(), 6), &#8216; &#8216;, &#8216;-&#8217;) AS [DD-Mon-YY]
                                                </td>
<td align="center">
                                                    25-Dec-05 <sup>1</sup>
                                                </td>
</tr>
<tr>
<td align="center">
                                                    DD-Mon-YYYY <sup>1</sup>
                                                </td>
<td>
                                                    SELECT REPLACE(CONVERT(VARCHAR(11), GETDATE(), 106), &#8216; &#8216;, &#8216;-&#8217;) AS [DD-Mon-YYYY]
                                                </td>
<td align="center">
                                                    25-Dec-2005 <sup>1</sup>
                                                </td>
</tr>
</table>
<p>
                                            <sup>1</sup> To make the month name in upper case, simply use<br />
                                            the UPPER string function.</p>
</td>
</tr>
<tr bgcolor="#ebffed">
<td style="padding:10px 10px 1px;">
<p>
                                            &nbsp;</p>
</td>
</tr>
</table>
</td>
<td valign="top" align="center">
                            &nbsp;
                        </td>
</tr>
</table>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sheldons.wordpress.com/112/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sheldons.wordpress.com/112/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sheldons.wordpress.com/112/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sheldons.wordpress.com/112/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sheldons.wordpress.com/112/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sheldons.wordpress.com/112/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sheldons.wordpress.com/112/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sheldons.wordpress.com/112/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sheldons.wordpress.com/112/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sheldons.wordpress.com/112/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sheldons.wordpress.com/112/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sheldons.wordpress.com/112/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sheldons.wordpress.com/112/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sheldons.wordpress.com/112/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sheldons.wordpress.com&amp;blog=16314082&amp;post=112&amp;subd=sheldons&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sheldons.wordpress.com/2011/07/07/sql-server-date-formats/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/a81efb47d8ef22151a85e5488d203ccc?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sheldons</media:title>
		</media:content>
	</item>
	</channel>
</rss>
