I'm writing some code in VB.NET which inserts some values into a table. I'm getting data from one table and inserting it into another table. There is a date field which I want to insert a NULL or blank value if it is NULL in the source table. As is it will insert the date 1/1/1900. Here is my code, which I have just summarized.
For Each dr as DataRow.....
Dim myDate = dr.item(myDT.myDateColumn)
If IsDBNull(myDate) Then
myDate = ""
<define connection variables....>
INSERT INTO dbo.TableName (MyDateField) VALUES (myDate)