mysql 连接 asp.net Odbc连接 首先必须安装驱动(MySQL Connector ODBC 5.1.5 win32 msi.zip) mysql5.0数据库(mysql-5.0.18-win32.exe) 以上都安装成功后: 测试代码: using System.Data.Odbc;//odbc protected void Page_Load(object sender, EventArgs e) { string ms = "Driver={MySQL ODBC 5.1 Driver};server=127.0.0.1;Database=mysql;uid=root;password=1;option=3"; OdbcConnection MyConn = new OdbcConnection(ms); MyConn.Open(); OdbcCommand mycm = new OdbcCommand("select * from user", MyConn); OdbcDataReader msdr = mycm.ExecuteReader(); while (msdr.Read()) { Response.Write("connection successed"); } msdr.Close(); MyConn.Close(); }