By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
428,813 Members | 2,269 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 428,813 IT Pros & Developers. It's quick & easy.

Setting Nulls in a date field

P: n/a
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
Nov 22 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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.
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
.

Nov 22 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.