Error with SmallDateTime data type
Hi.
I'm working with an ASP.NET page that displays dates & times from a SQL Server 2000 database. The fields are formatted in both the ASP page & database to appear 'mm/dd/year'.
My problem is in updating the information. If any date / time field is blank, I get the following error: "System.FormatException: String was not recognized as a valid DateTime"
In the connection settings for the ASP.NET page, I have the input variable declared: Dim objUpdateContactParameter12 As New SqlParameter("@DateVerified", SqlDbType.SmallDateTime, 4)".
In the called stored procedure, the input varible is declared with "@DateVerified SmallDateTime" and the SET command orders the update "CntyDateVerified = @DateVerified".
In the database the field is set to accept NULL values.
What do I need to do to have the page pass a NULL value on to the database? Also, if you know of someplace where I can read up on this, I would really appreciate it.
Thank you.
|