MySqlConnection is not working
本文关键字:working not is MySqlConnection | 更新日期: 2023-09-27 18:21:44
我看过一个使用MySqlConnection variable name = new MySqlConnection(connection string);
的教程
但是,当我在Visual Studio Express 2013中键入上述代码时,它(MySqlConnection
)不会变为蓝色。上面写着The type or namespace MySqlConnection could not be found
。我在谷歌上搜索过,但一无所获。有人能帮忙吗?很抱歉问了这个愚蠢的问题,但我完全不知道。
您必须下载MySQL连接器并将其引用到VS项目。
查看此链接:http://dev.mysql.com/downloads/connector/net/
添加引用后,使用将以下内容添加到您的类中:
using MySql.Data.MySqlClient;
那么您的代码应该可以工作了。