Data Conversion and Validation
page 5 of 7
by Brian Mains
Feedback
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 5244/ 291

Date Type Ranges

Date types in the .NET Framework are supported with SQL Server databases, but you have to be aware of the range of values. For instance, the .NET Framework supports a minimum date value of 1/1/0001, which is not supported in SQL Server.

In SQL Server, the datetime data type minimum value is 1/1/1753 and the smalldatetime data type minimum is 1/1/1900. In the maximum mindset, smalldatetime's value does not fit within the DateTime.MaxValue property range.

If a date outside this range is passed in, a DateTime overflow exception is thrown, which is obviously an issue with data conversion. In addition, the string type does not have any length restrictions, which are not easily catchable unless manually validated.


View Entire Article

Article Feedback

Title:  
Name:  
Url: ( Optional )
Comment:  
Please add 5 and 7 and type the answer here:

User Comments

No comments posted yet.

Product Spotlight
Product Spotlight 
Learn More
.NET Tools
asp.net shopping cart
asp.net chart control






Community Advice: ASP | SQL | XML | Regular Expressions | Windows


©Copyright 1998-2008 ASPAlliance.com  |  Page Processed at 11/21/2008 4:35:22 AM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search