链接mysql数据库有2种dll包 不同的包用法不一样
MySql.Data.dll
这个包的用法:
using MySql.Data.MySqlClient;
private static string DB_CON_STR = "server=localhost;uid=root;pwd=991446;database=labmanger;Character Set=utf8";
MySqlConnection conn = new MySqlConnection(DB_CON_STR);
MySqlCommand cmd = new MySqlCommand(strSql, conn);
MySqlDataAdapter sda = new MySqlDataAdapter(strSql, conn);
MySQLDriverCS.dll
这个包的用法:
using MySQLDriverCS;
static string strCon = new MySQLConnectionString("localhost", "labmanger", "root", "123").AsString;
MySQLConnection conn = new MySQLConnection(strCon);
MySQLCommand comm = new MySQLCommand(strSql, conn);
MySQLDataAdapter sda = new MySQLDataAdapter(strSql, conn);