Assign the null value to DB2 fields.
Hi John,
Ah, okay, sounds like you are referencing the field via a strongly typed dataset.
If that is the case, you can have a SetXXXToNull method that set's the underlying
value to dbNull.Value. You basically have to bypass the strongly typed interface
you have because Integers always have a value.
Quote:
> Yes, I did.
> but, I got a error "Value of type 'System.DBNull' cannot
> be converted to 'integer'".
> >-----Original Message-----
> >Hi John,
> >Have you tried :
> > My_DB2_Field = System.DBNull.Value
> >> Hi, I am using the ODBC to connect to DB2 database, and
> I
> >> would like to write new records to my table. I need to
> >> assign the null value to some fields. I tried to use the
> >> following code:
> >> My_DB2_Field = Nothing
> >> ,but VB assign the 0 to My_DB2_Field. Can anyone help me
> >> with this?(some sample code will be great) Thanks!
> >.