mysql - vb无法连接数据库

标签 mysql vb.net

我已经下载并安装了连接器,但它没有出现在 .Net 选项卡中。那我现在该怎么办?

第一次警告:

Namespace or type specified in the Imports 'MySql.Data.MysqlClient' doesn't contain any public member or cannot be found. Make sure namespace or the type is defined and contains at least one public member. Make sure the imported element name doesn't use any aliases.

第二次警告:

This primary reference "MySql.Data, Version=6.9.5.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL"could not be resolved because it has as indirect dependency on the .NET Framework assembly "Accessibility, Version=4.0.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a"which has a higher version "4.0.0.0" thanthe version "2.0.0.0" in the current target framework.

最佳答案

在项目属性中将 .NET Framework 的目标版本更改为 .NET 4.0。这应该可以解决两个警告,因为它将清除第二个警告,这将使引用的程序集与导入的命名空间一起使用。

enter image description here

enter image description here

关于mysql - vb无法连接数据库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27079882/

相关文章:

mysql - SQL 不适用于同一表中一列到另一列的简单 SET

PHP mysql_fetch_array() 根本不工作

php - 我如何在 php 中的简单数组中包含关联数组?

SQL 语句作为列表框 VB.NET 的数据源

vb.net - "Cannot open a database created with a previous version of your application"显示 VB.NET 程序尝试使用 OleDBConnection 打开 MDB 文件时

MySQL使用不同的键获取相同的参数

mysql - 在 IN() 条件中混合带引号和不带引号的值 - MySQL 怪癖还是一般问题?

.net - 如何将 Queue(Of String) 作为字符串连接?

vb.net - VB.NET 中的多个选择案例

vb.net - 如何使用参数将新任务声明为 SUB