Got stuck with a problem!!!
-
Hi To ALL! In VB.NET, i have an integer variable whose value is set to 0 but i need to convert the value of the variable as null while saving to sql database. for example, dim i as integer i=0 ie, i need to convert the value of i to null can i be able to do that ? Pls give me some suggestions Regards, Mahesh
-
Hi To ALL! In VB.NET, i have an integer variable whose value is set to 0 but i need to convert the value of the variable as null while saving to sql database. for example, dim i as integer i=0 ie, i need to convert the value of i to null can i be able to do that ? Pls give me some suggestions Regards, Mahesh
You could use
DbNull.Value
, found here[^] in the MSDN documentation. All you would need to do is checki
for a 0 value before you either assign the value ofi
to your parameter object or the value ofDbNull.Value
. RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome