|
-
Aug 13th, 2010, 11:28 AM
#1
Thread Starter
Hyperactive Member
[RESOLVED] DBNull to type String is not valid. From a datagrid
I am trying to populate a textbox.text with a value with a record from a datagrid.
I can get my value from the datagrid by the following
Dim eRow As Integer
eRow = datagrid.CurrentRow.Index
txtSelecteditem.Text = datagrid.Item(0, eRow).Value
This all works fin when there is a value in the cell it is picking up. However, I hit a problem when this filed is blank.
The error I get is:
Conversion from type 'DBNull' to type 'String' is not valid.
How can I get the textbox to populate with null if the field is null.
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
|