Hi All!
I have recently downloaded and installed MySql data base.
I'm working on windows xp pro; visual studio 2003 .net; c#
In addition, I've downloaded and installed the MySql Administrator app with which I have created a schema and
a table in MysQl.
I Can not manage to connect the odbc classes with MySql!!!!!
the connection string I wrote is:
protected string strConnect = "DRIVER={MySQL ODBC 3.51 Driver};Data C:\\MySQL\\MySQL Server 4.1\\data\mysql\\time_zone.frm;SERVER=localhost;DATABASE=mysql;UID=root;PASSWORD=1;OPTION=3";
Th way I'm trying to connect and get the data is:
try
{
odbcConn = new OdbcConnection();
odbcConn.ConnectionString = strConnect;
string SQL = "SELECT * FROM mysql";
odbcCommand = new OdbcCommand(SQL);
odbcConn.Open();
odbcDR = odbcCommand.ExecuteReader();
while( odbcDR.Read() )
{
richTextBox1.Text = "LangID: " + odbcDR["GroupId"] + " , ";
richTextBox1.Text = "Desc :" + odbcDR["Description"];
}
odbcDR.Close();
odbcConn.Close();
}
catch(System.Exception err)
{
richTextBox1.Text = err.Message;
}
In the data source which are the files (exrensions) to connect, refering MySql?? (.frm,.myd)
what are the differences??
And most of all WHAT am I DOING WRONG??
Thax deeply!
I have recently downloaded and installed MySql data base.
I'm working on windows xp pro; visual studio 2003 .net; c#
In addition, I've downloaded and installed the MySql Administrator app with which I have created a schema and
a table in MysQl.
I Can not manage to connect the odbc classes with MySql!!!!!
the connection string I wrote is:
protected string strConnect = "DRIVER={MySQL ODBC 3.51 Driver};Data C:\\MySQL\\MySQL Server 4.1\\data\mysql\\time_zone.frm;SERVER=localhost;DATABASE=mysql;UID=root;PASSWORD=1;OPTION=3";
Th way I'm trying to connect and get the data is:
try
{
odbcConn = new OdbcConnection();
odbcConn.ConnectionString = strConnect;
string SQL = "SELECT * FROM mysql";
odbcCommand = new OdbcCommand(SQL);
odbcConn.Open();
odbcDR = odbcCommand.ExecuteReader();
while( odbcDR.Read() )
{
richTextBox1.Text = "LangID: " + odbcDR["GroupId"] + " , ";
richTextBox1.Text = "Desc :" + odbcDR["Description"];
}
odbcDR.Close();
odbcConn.Close();
}
catch(System.Exception err)
{
richTextBox1.Text = err.Message;
}
In the data source which are the files (exrensions) to connect, refering MySql?? (.frm,.myd)
what are the differences??
And most of all WHAT am I DOING WRONG??
Thax deeply!