简体   繁体   中英

Can I connect mysql to visual studio 2010 express visual tools

My question is about Express edition vs Professional, should I be able to use the database connections with MySql .net connector in the express edition? Or does it only work in the Professional edition? I'm using express and I've tried the latest .net connector and it still doesn't show up in the database connections list.

MySQL Connector/NET will not work in the Express Version of Microsoft Studio due to limitations within the express products. In order to use Data sources based in server architecture Non-"Express" versions must be used. Connectivity to even Microsoft's Own MSSQL will not work, aside from local limited "Compact" or "Express" versions.

In Express Editions you can add the dll conector to the project references:

add references

mysql.data.dll

then use it like a class:

Imports MySql.Data.MySqlClient

Public Class Form1

Dim mycon As New MySqlConnection

Dim myadp As New MySqlDataAdapter

search in mysql documentation for more info.

To use in C#, after adding the reference, you use it like this:

// 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);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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