I am getting the following error:
Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.
Exception Details: System.InvalidC astException: Specified cast is not
valid.
Line 60: Dim myCommand As New MySqlCommand(my InsertQuery)
Line 61: myCommand.Conne ction = myConnection
Line 62: myConnection.Op en()
Line 63: myCommand.Execu teNonQuery()
Line 64: myCommand.Conne ction.Close()
from this code:
Dim myConnectionStr ing As String
="SERVER=localh ost;DATABASE=ev aluation;UID=<u sername>;PASSWO RD=<password>;"
Dim myConnection As New MySqlConnection (myConnectionSt ring)
Dim myInsertQuery As String = "insert into tbl_ssa (ipAddress) values
('127.188.01.01 ')"
Dim myCommand As New MySqlCommand(my InsertQuery)
myCommand.Conne ction = myConnection
myConnection.Op en()
myCommand.Execu teNonQuery()
myCommand.Conne ction.Close()
I have no idea why this is happening. The database and table exist, I
can connect with other projects.
Any help in sorting this out would be greatly appreciated.
Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.
Exception Details: System.InvalidC astException: Specified cast is not
valid.
Line 60: Dim myCommand As New MySqlCommand(my InsertQuery)
Line 61: myCommand.Conne ction = myConnection
Line 62: myConnection.Op en()
Line 63: myCommand.Execu teNonQuery()
Line 64: myCommand.Conne ction.Close()
from this code:
Dim myConnectionStr ing As String
="SERVER=localh ost;DATABASE=ev aluation;UID=<u sername>;PASSWO RD=<password>;"
Dim myConnection As New MySqlConnection (myConnectionSt ring)
Dim myInsertQuery As String = "insert into tbl_ssa (ipAddress) values
('127.188.01.01 ')"
Dim myCommand As New MySqlCommand(my InsertQuery)
myCommand.Conne ction = myConnection
myConnection.Op en()
myCommand.Execu teNonQuery()
myCommand.Conne ction.Close()
I have no idea why this is happening. The database and table exist, I
can connect with other projects.
Any help in sorting this out would be greatly appreciated.
Comment