无法导入MySql.Data.MySqlClient [英] unable to import MySql.Data.MySqlClient
问题描述
我创建了一个使用 MySQL
数据库的网站,但是当我将其放在网上时,它不再起作用。在我用于连接数据库的类 connection.vb
中,收到以下警告:
I have created a website that uses a MySQL
database, but when i put it online, it doesn't work anymore. in my class connection.vb
that i use for my connection to my database i get the following warning:
在导入'MySql.Data.MySqlClient'中指定的名称空间或类型不包含任何公共成员或找不到。确保已定义名称空间或类型,并且至少包含一个公共成员。确保导入的元素名称不使用任何别名。
Namespace or type specified in the Imports 'MySql.Data.MySqlClient' doesn't contain any public member or cannot be found. Make sure the namespace or the type is defined and contains at least one public member. Make sure the imported element name doesn't use any aliases.
,它表示未定义类型 mysqlconnection
。
这是我的代码:
Imports Microsoft.VisualBasic
Imports MySql.Data.MySqlClient
Public Class connection
Public Shared cn As New MySqlConnection(ConfigurationManager.ConnectionStrings("cnDatabase").ConnectionString)
End Class
如果我在其他 vb
文件中执行相同的import语句,例如例如index.aspx.vb它不会给我任何错误
If i do the same imports statement in an other vb
file such as e.g index.aspx.vb it gives me no error
有人知道错在哪里吗?
Does anybody know what is wrong?
预先感谢。
推荐答案
尝试一下,
- 双击我的项目。
- 在参考选项卡中,删除MySQL.Data。
- 尝试重新安装。
这篇关于无法导入MySql.Data.MySqlClient的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!