透過ODBC讀取MYSQL
C#
1.using System.Data.Odbc;
2. OdbcConnection odbcCon ;
OdbcCommand odbcCmd;
OdbcDataReader dataSet;
string conString;
odbcCon = new OdbcConnection(conString);
odbcCon.Open();
odbcCmd = new OdbcCommand();
odbcCmd.Connection = odbcCon;
odbcCmd.CommandText = "select EMP_no,EMP_NM,START_DT from bdm2emp";
dataSet = odbcCmd.ExecuteReader();
while (dataSet.Read())
{
row.Add(new object[] { dataSet[0],dataSet[1],dataSet[2]});
}
odbcCon.Close();
dataSet.Close();