Skip to content

Instantly share code, notes, and snippets.

@facebookegypt
Last active August 18, 2019 23:19
Show Gist options
  • Save facebookegypt/48e2d68f8917a23dc03e46084107056b to your computer and use it in GitHub Desktop.
Save facebookegypt/48e2d68f8917a23dc03e46084107056b to your computer and use it in GitHub Desktop.
Conversion from type 'DBNull' to type 'String' is not valid.
'adonetaccess2003.blogspot.com
'This method uses connected mode
If IsDBNull(DataReader!Field_Name) Then
TextBox1.Text = ("Anything you wish for now")
Exit Sub
End If
'Another method using disconnected mode 'DataSet'
TextBox1.Text = DataTable.Rows(0)("Field_Name").ToString()
'Another method from Database Table.
Dim SqlStr As String = "select IsNull(Field_Name,'') as Any_Name from Table_Name"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment