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): 13588/ 197

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 6 and 4 and type the answer here:

User Comments

No comments posted yet.

Product Spotlight
Product Spotlight 






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


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