I'm getting this error when I try to populate my page. The field can be null in the database, so how do I get around this?
Cast from type 'DBNull' to type 'String' is not valid.
Printable View
I'm getting this error when I try to populate my page. The field can be null in the database, so how do I get around this?
Cast from type 'DBNull' to type 'String' is not valid.
this is how you can handle null values :
VB Code:
Dim MyNull As System.DBNull If mystring Is MyNull Then 'do things End If
thanks...I used:
Code:If objDataReader("display_start_date") Is DBNull.Value Then
txtIntDisStartDate.Text = String.Empty
Else
txtIntDisStartDate.Text = ("display_start_date")
End If