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

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

User Comments

Title: good   
Name: jay
Date: 2010-01-29 1:45:56 AM
good article.. but confusing words....

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

©Copyright 1998-2024  |  Page Processed at 2024-06-24 9:12:46 AM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search