Dave Burke : Freelance .NET Web Developer specializing in Online Communities

Now a SQL DateTime man (no more SmallDateTime for me!)

I mentioned the other night some dealings with using nullable value types in a SQL DateTime datatype.  I decided to go with my own date code for a condition, then null the value in the DL.  In this case I used '1/1/1869.' 

But then I get the runtime:

SqlDbType.SmallDateTime overflow. Value '1/1/1869 12:00:00 AM' is out of range. Must be between 1/1/1900 12:00:00 AM and 6/6/2079 11:59:59 PM.

I've used SmallDateTime out of habit for years in setting up SQL field datatypes.  No more.  That's a pretty small time span when you think about it--not that we typically have a lot of use for 19th century dates, and I'm pretty sure I'll be dead in 2079 so I won't have to worry about updating my code, but still...

Comments (0) | Post RSS RSS comment feed

Posted on 3/30/2004 7:22:00 PM by Dave Burke
Categories:
Tags: No tags for this post

Related posts

Comments are closed

This site was built with the Sueetie .NET Open Source Community Framework. Learn more about Sueetie at Sueetie.com.