G
Guest
Hello,
I am having a problem getting data from a MySQL database using an ODBC
connection. The below code
works 100% in a Windows Form but not in my ASP.Net Web Form. It returns the
error "The Connection
Is Dead" at the oDBA.Fill line.
I have MySQL's MyODBC drive version 3.51.09 on the server which is the latest.
Any suggestions or help? Am I missing a command (like you have to use
DataBind on a WebForm but not
on a Windows Form)?
string sSQL;
sSQL = "SELECT FilePath, FileName, FileExt, " +
"Document_Name, Revision, Sheet_Name " +
"FROM Document_Locations " +
"WHERE File_ID = " + sTIFID + ";";
string MyConString = "DRIVER={MySQL ODBC 3.51 Driver};" +
"SERVER=cochise;" +
"DATABASE=ISTAR;" +
"UID=root;" +
"PASSWORD=;" +
"OPTION=3";
OdbcConnection myConnection;
OdbcCommand myCommand;
OdbcDataAdapter oDBA;
DataSet dsRecords = new DataSet();
myConnection = new OdbcConnection(MyConString);
myCommand = new OdbcCommand(sSQL, myConnection);
oDBA = new OdbcDataAdapter(myCommand);
oDBA.Fill(dsRecords);
myConnection.Close();
Thanks,
Kevin
I am having a problem getting data from a MySQL database using an ODBC
connection. The below code
works 100% in a Windows Form but not in my ASP.Net Web Form. It returns the
error "The Connection
Is Dead" at the oDBA.Fill line.
I have MySQL's MyODBC drive version 3.51.09 on the server which is the latest.
Any suggestions or help? Am I missing a command (like you have to use
DataBind on a WebForm but not
on a Windows Form)?
string sSQL;
sSQL = "SELECT FilePath, FileName, FileExt, " +
"Document_Name, Revision, Sheet_Name " +
"FROM Document_Locations " +
"WHERE File_ID = " + sTIFID + ";";
string MyConString = "DRIVER={MySQL ODBC 3.51 Driver};" +
"SERVER=cochise;" +
"DATABASE=ISTAR;" +
"UID=root;" +
"PASSWORD=;" +
"OPTION=3";
OdbcConnection myConnection;
OdbcCommand myCommand;
OdbcDataAdapter oDBA;
DataSet dsRecords = new DataSet();
myConnection = new OdbcConnection(MyConString);
myCommand = new OdbcCommand(sSQL, myConnection);
oDBA = new OdbcDataAdapter(myCommand);
oDBA.Fill(dsRecords);
myConnection.Close();
Thanks,
Kevin