C# - MySQL ODBC connection not OleDB
1] download and install MySQL ODBC driver
2] Configuce MySQL ODBC driver (data source)
3]
using System.Data;
using System.Data.Odbc;
OdbcConnection conn = new OdbcConnection("DSN=mysql1");
conn.Open();
OdbcCommand command = new OdbcCommand("SELECT id,xml_url,server_url FROM uzivatele", conn);
OdbcDataReader reader = command.ExecuteReader();
while (reader.Read())
{
string s1 = reader.GetValue(0).ToString();
string s2 = reader.GetValue(1).ToString();
string s3 = reader.GetValue(2).ToString();
}
Article C# - MySQL ODBC connection not OleDB
C# - MySQL ODBC connection not OleDB