Hi,
I get this error but i dont understand why... here is the code :
The error happens on the ... length = Me.convertor.CmToInches(reader.GetString(2)) line but if i place a watch on reader.GetString(2) it is not null. I can see there is a value of a string with numbers like "1234.56" !!!
I get this error but i dont understand why... here is the code :
Code:
Try
conn.Open() 'Open a connection to database
Dim stm As String = "SELECT * FROM myTable"
Dim cmd As MySqlCommand = New MySqlCommand(stm, conn)
Dim reader As MySqlDataReader = cmd.ExecuteReader()
While reader.Read()
length = Me.convertor.CmToInches(reader.GetString(2))
End While
Catch ex As MySqlException
MsgBox("Error: " & ex.ToString())
Finally
conn.Close() 'Close connection to database
End Try
The error happens on the ... length = Me.convertor.CmToInches(reader.GetString(2)) line but if i place a watch on reader.GetString(2) it is not null. I can see there is a value of a string with numbers like "1234.56" !!!