|
-
Oct 15th, 2002, 07:36 AM
#1
Thread Starter
Fanatic Member
Checking for Null
The following code :
If Not objROw2(0).Item("ClientLocality") Is Nothing Then
Me.lblLocality.Text = objROw2(0).Item("ClientLocality")
End If
Causes the following error when it contains nothing:
Additional information: Cast from type 'DBNull' to type 'String' is not valid.
Whats happening??
Thanks in Advance
-
Oct 15th, 2002, 02:40 PM
#2
Lively Member
Try it this way instead:
If Not objROw2(0).Item("ClientLocality") Is DBNull.Value Then
Me.lblLocality.Text = objROw2(0).Item("ClientLocality")
End If
Basically, just change "Nothing" to "DBNull.Value".
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|