HSN
December 31st, 2005, 03:50 PM
Hi,
I'm trying to use mySQL along with C#.
Here is my procedure for connecting to mysql:
internal void mySQL()
{
string mySQLString = "DRIVER={MySQL};DATABASE=system;";
mySQLString += "SERVER=localhost;";
mySQLString += "UID=root;PWD=1234;";
System.Data.Odbc.OdbcConnection myDb = new OdbcConnection(mySQLString);
try
{
myDb.Open();
}
catch (System.Exception E)
{
MessageBox.Show(E.ToString());
}
}
and I get the following exception:
ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
please help me with that.
I'm trying to use mySQL along with C#.
Here is my procedure for connecting to mysql:
internal void mySQL()
{
string mySQLString = "DRIVER={MySQL};DATABASE=system;";
mySQLString += "SERVER=localhost;";
mySQLString += "UID=root;PWD=1234;";
System.Data.Odbc.OdbcConnection myDb = new OdbcConnection(mySQLString);
try
{
myDb.Open();
}
catch (System.Exception E)
{
MessageBox.Show(E.ToString());
}
}
and I get the following exception:
ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
please help me with that.