C
Charles Law
I am using VB (although the language is presumably academic) to insert
records into a SQL Server 2005 database. The database has a datetime column
that is nullable.
Inserting dates normally is fine, but when I have a datetime variable in VB
that returns Nothing, I get an overflow exception from the database.
What is the correct way to deal with datetime types that evaluate to
Nothing?
I realise that I could test the variable and insert something like
System.DBNull.Value when the variable is Nothing, but that seems like a
kludge. What is the designed Microsoft approach to this problem?
TIA
Charles
records into a SQL Server 2005 database. The database has a datetime column
that is nullable.
Inserting dates normally is fine, but when I have a datetime variable in VB
that returns Nothing, I get an overflow exception from the database.
What is the correct way to deal with datetime types that evaluate to
Nothing?
I realise that I could test the variable and insert something like
System.DBNull.Value when the variable is Nothing, but that seems like a
kludge. What is the designed Microsoft approach to this problem?
TIA
Charles