繁体   English   中英

我可以将mysql连接到visual studio 2010 express可视化工具

[英]Can I connect mysql to visual studio 2010 express visual tools

我的问题是Express Edition vs Professional,我是否可以在快递版中使用MySql .net连接器的数据库连接? 或者它只适用于专业版? 我正在使用快递,我已经尝试了最新的.net连接器,它仍然没有显示在数据库连接列表中。

由于快递产品的限制,MySQL Connector / NET将无法在Microsoft Studio的Express版本中运行。 要使用基于服务器体系结构的数据源,必须使用非“Express”版本。 除了本地有限的“Compact”或“Express”版本之外,连接到微软自己的MSSQL也行不通。

在Express Edition中,您可以将dll conector添加到项目引用中:

添加引用

mysql.data.dll

然后像课一样使用它:

Imports MySql.Data.MySqlClient

Public Class Form1

Dim mycon As New MySqlConnection

Dim myadp As New MySqlDataAdapter

搜索mysql文档以获取更多信息。

要在C#中使用,在添加引用后,您可以像这样使用它:

// Put this at the top of the file, with the other "using..." lines
using MySql.Data.MySqlClient;

// [...]
public Form1() {
  MySqlConnection myCon = new MySqlConnection();
  MySqlDataAdapter myAdapter = new MySqlDataAdapter("SELECT * FROM foo;", myCon);

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM