清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>
MySQLDriverCS下载地址:
http://go.rritw.com/sourceforge.net/projects/mysqldrivercs/
static void Main(string[] args)
{
MySQLConnection conn = new MySQLConnection(new MySQLConnectionString("127.0.0.1","student", "root", "root",3306).AsString);
conn.Open();
MySQLCommand cmd = new MySQLCommand("select * from stuinfo", conn);
DbDataReader reader = cmd.ExecuteReader();
while (reader.Read())
{
Console.WriteLine(reader.GetString(0) + " " + reader.GetString(1) + " " + reader.GetString(2) + " " + reader.GetString(3));//读出查询的结果
}
Console.ReadKey();
reader.Close();
conn.Close();//关闭连接
}