I have a null value in a table. When I read it, it automatically fails. I have tried several things I found on the net but nothing works. As long as it is a string it works.
Any suggestions....
Dim mySelectQuery As String = "select * from dbo.znid where left(znidadd,7)= '" & ComboBox1.Text & "'"
Dim myConnection As New OdbcConnection(myConnString)
Dim myCommand As New OdbcCommand(mySelectQuery, myConnection)
myConnection.Open()
Dim myReader As OdbcDataReader = myCommand.ExecuteReader()
Try
While myReader.Read()
'****code fails here******
Console.WriteLine(myReader.GetString(1))
End While
Finally
Thanks
Simi
Any suggestions....
Dim mySelectQuery As String = "select * from dbo.znid where left(znidadd,7)= '" & ComboBox1.Text & "'"
Dim myConnection As New OdbcConnection(myConnString)
Dim myCommand As New OdbcCommand(mySelectQuery, myConnection)
myConnection.Open()
Dim myReader As OdbcDataReader = myCommand.ExecuteReader()
Try
While myReader.Read()
'****code fails here******
Console.WriteLine(myReader.GetString(1))
End While
Finally
Thanks
Simi