Setting Nulls in a date field

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a date field in a SQL table that allows null.

If certain conditions are met in the user interface I need to set the field to nulls.

using a typed dataset I do the following

Dim rOrgPolicyRow As dsTyped.orgpolicyRow = tOrgPolicy.NeworgpolicyRow

I am attempting to set the field = to null using the following code.

rOrgPolicyRow.termdate = DBNull.Value

I get an error saying that system.dbnull cannot be converted to date.

Has anyone else experienced the same problem? If so how did you resolve?

Thanks
 
This is just a thought, but you may want to check that the
definition of the dataset, I'm assuming it's an XML file
allows nulls for the column in question. You can view the
XML and it should show minOccurs="0".

Good luck.

-----Original Message-----
I have a date field in a SQL table that allows null.

If certain conditions are met in the user interface I
need to set the field to nulls.
 
Back
Top