I've been using this for quite a while, and I recently changed hostings. when I used the script, it says
ERROR [42000] [MySQL][ODBC 3.51 Driver][mysqld-5.1.68-community] You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
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.Data.Odbc.OdbcException: ERROR [42000] [MySQL][ODBC 3.51 Driver][mysqld-5.1.68-community]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
Source Error:
Line 16: connectme.Open() Line 17: Dim ODBCdataadapter As OdbcDataAdapter = New OdbcDataAdapter(sqlquery, connectme) Line 18: ODBCdataadapter.Fill(ODBCdataset, "table") Line 19:
connectme.Close()
What went wrong?
Comment code
Dim connectionstring As String = ConfigurationManager.ConnectionStrings("DBstring").ConnectionString
Dim connectme As OdbcConnection = New OdbcConnection(connectionstring)
Dim ODBCdataset As DataSet = New DataSet()
Dim sqlquery As String = "SELECT * FROM table WHERE fno = " & Request.QueryString("id")
connectme.Open()
Dim ODBCdataadapter As OdbcDataAdapter = New OdbcDataAdapter(sqlquery, connectme)
ODBCdataadapter.Fill(ODBCdataset, "tkhstock") connectme.Close()