我如何从.aspx脚本连接到MySQL

时间:2011-12-23 17:56:37

标签: mysql odbc mysqli

我收到错误:

BC30807: 'Let' and 'Set' assignment statements are no longer supported.

使用:

Set objConn = Server.CreateObject("ADODB.Connection")

1 个答案:

答案 0 :(得分:0)

像这样:

using MySql.Data.MySqlClient;

MySqlConnection myConnection = new MySqlConnection();

myConnection.ConnectionString = myConnectionString;
myConnection.Open();
//execute queries, etc
myConnection.Close();

myConnectionString的格式如下:

"Server=myServerAddress;Database=myDataBase;Uid=myUsername;Pwd=myPassword;"