How to insert NULL to Database from VB.NET

  • Thread starter Thread starter Patrick Olurotimi Ige
  • Start date Start date
P

Patrick Olurotimi Ige

How can i insert NULL below?
It says i can;t convert it to character!!

Dim MB As Char
If Request.Params("MB") = "True" Then
MB = "Y"
ElseIf Request.Params("MB") = "False" Then
MB = "N"
Else
MB = Convert.ToChar(DBNull.Value)

End If
 
A Char character cannot be null, but you can set the value of a SQLParameter
object to DBNull.Value.
 
Hi Steve thanks for the reply.
I taught i could do it in my code.
But if i set it to NOTHING
And then check my table i see a "box" in the field whats NOTHING
inserting?
 
Back
Top