How to assign a null value to the Column in the Database from VB.N

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

Guest

I want to assign null value to a column in the database which is decalred as
an integer from VB.net...

Is there any specific keyword like vbNull as in vb 6.0.
 
Prabhudhas Peter said:
I want to assign null value to a column in the database which is decalred
as
an integer from VB.net...

Is there any specific keyword like vbNull as in vb 6.0.

Assign 'SqlInt32.Null' to the 'Value' property of your 'SqlInt32', if you
are using the 'Sql*' types. For a more general replacement, take a look at
'DBNull.Value'.
 
Something like this:
myvalue = DBNull.Value

That will set the column's value (myvalue in this case) to DBNull.Value.

james
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top