M
Matthew Workman
Hi...
I am trying to do a "basic" ODBC connection to my MYSQL Database being
hosted at discountasp. For the life of me, I can't get anything to return...
could someone lend a hand? Here is my code:
--------------------------------
string MyConString = "DRIVER={MySQL ODBC 3.51 Driver};" +
"SERVER=hostnameatdiscountasp;" +
"DATABASE=myassigneddatabase;" +
"UID=;" +
"PASSWORD=;" +
"OPTION=3";
OdbcConnection MyConnection = new OdbcConnection(MyConString);
MyConnection.Open();
OdbcCommand MyCommand = new OdbcCommand();
MyCommand.CommandText = "SELECT * FROM sometesttable";
OdbcDataReader MyDataReader;
MyDataReader = MyCommand.ExecuteReader();
while (MyDataReader.Read())
{
Label1.Text = MyDataReader.GetString(1);
}
MyDataReader.Close();
MyConnection.Close();
----------------------------
Any ideas on what might be the problem?
Thanks a bunch.
Matthew Workman
TLWI
I am trying to do a "basic" ODBC connection to my MYSQL Database being
hosted at discountasp. For the life of me, I can't get anything to return...
could someone lend a hand? Here is my code:
--------------------------------
string MyConString = "DRIVER={MySQL ODBC 3.51 Driver};" +
"SERVER=hostnameatdiscountasp;" +
"DATABASE=myassigneddatabase;" +
"UID=;" +
"PASSWORD=;" +
"OPTION=3";
OdbcConnection MyConnection = new OdbcConnection(MyConString);
MyConnection.Open();
OdbcCommand MyCommand = new OdbcCommand();
MyCommand.CommandText = "SELECT * FROM sometesttable";
OdbcDataReader MyDataReader;
MyDataReader = MyCommand.ExecuteReader();
while (MyDataReader.Read())
{
Label1.Text = MyDataReader.GetString(1);
}
MyDataReader.Close();
MyConnection.Close();
----------------------------
Any ideas on what might be the problem?
Thanks a bunch.
Matthew Workman
TLWI