[英]The type or namespace name 'MySql' could not be found (are you missing a using directive or an assembly reference?) c# VS 2013
I added reference to MySql.Data.dll from mysql connector 6.9.10 installation. 我从mysql连接器6.9.10安装中添加了对MySql.Data.dll的引用。 But still i get error: The type or namespace name 'MySql' could not be found (are you missing a using directive or an assembly reference?) using c# in VS 2013 但仍然出现错误:在VS 2013中使用c#找不到类型或名称空间名称'MySql'(您是否缺少using指令或程序集引用?)
On the *.cs file you are trying to use the MySql connector, you need a Using Statement. 在试图使用MySql连接器的* .cs文件上,您需要一个Using语句。
Go to the line that you have the error on, the red squiggly. 转到错误所在的行,红色弯曲。 put the cursor on the word and press Ctrl . 将光标放在单词上,然后按Ctrl。 (period) You'll be presented with an option to add the using statement to the top of the file. (句点)将为您提供一个将using语句添加到文件顶部的选项。
The problem was with the version incompatibility of .Net and Mysql i was using. 问题是我正在使用的.Net和Mysql的版本不兼容。 My project is compiled with .net 3.5 and am trying to use Mysql.data dll from connector 6.9. 我的项目是使用.net 3.5编译的,正在尝试使用连接器6.9中的Mysql.data dll。 Issue resolved after using dll from MySql connector 6.3.9/v2.0. 使用MySql连接器6.3.9 / v2.0中的dll后解决的问题。 Too bad that the error is misleading. 太糟糕了,该错误会引起误解。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.