Hi
I am having a problem with nulls in a database field. I have an object which produces a dataset, to which I then select a specific datarow. I want to check if a field in that datarow is null. However I keep getting this error "Cast from type 'DBNull' to type 'String' is not valid."
This is my code
Private Sub checkForNull(ByVal strArID As String)
rw = a.GetRow(strArID) 'this gets a specific row
If IsDBNull(rw.Area_ArID) Then
lable1.text = "DB is Null"
Else
label1.text = "DB has a value"
End If
End Sub
Thanks in advance
I am having a problem with nulls in a database field. I have an object which produces a dataset, to which I then select a specific datarow. I want to check if a field in that datarow is null. However I keep getting this error "Cast from type 'DBNull' to type 'String' is not valid."
This is my code
Private Sub checkForNull(ByVal strArID As String)
rw = a.GetRow(strArID) 'this gets a specific row
If IsDBNull(rw.Area_ArID) Then
lable1.text = "DB is Null"
Else
label1.text = "DB has a value"
End If
End Sub
Thanks in advance