Data Grid View

SIMIN

Regular
Joined
Mar 10, 2008
Messages
92
DataGridViewX.CurrentRow.Cells.Item(0).Value.ToString

If the item is blank and no data is entered it will throw a null exception, so the question is that how can I check if the item is null or not?

Even using this:

If DataGridViewX.CurrentRow.Cells.Item(0).Value.ToString IsNot Nothing Then ...

Will thro the exception!
Please help me.
 
I normally use:
Visual Basic:
If DataGridViewX.CurrentRow.Cells.Item(0).Value IsNot System.DBNull.Value Then
'???
End If
 
Back
Top