using MySQLDriverCS;
// 建立数据库连接MySQLConnection DBConn;DBConn = new MySQLConnection(new MySQLConnectionString("localhost","mysql","root","",3306).AsString);DBConn.Open();
// 执行查询语句MySQLCommand DBComm;DBComm = new MySQLCommand("select Host,User from user",DBConn);
// 读取数据MySQLDataReader DBReader = DBComm.ExecuteReaderEx();
// 显示数据try{while (DBReader.Read()){Console.WriteLine("Host = {0} and User = {1}", DBReader.GetString(0),DBReader.GetString(1));}}finally{DBReader.Close();DBConn.Close();}
//关闭数据库连接DBConn.Close();