Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to connect to a MySQL Data Source in Visual Studio

I use the MySQL Connector/Net to connect to my database by referencing the assembly (MySql.Data.dll) and passing in a connection string to MySqlConnection. I like that because I don't have to install anything.

Is there some way to "Choose Data Source" in Visual Studio 2010 without installing something?

How can I get a MySQL option (localhost) to show up on one of these lists? Or do I have to install something?

(I don't want to use ODBC btw)

"Add Connection" from Server Explorer: alt text

Entity Data Model Wizard: alt text

like image 791
JohnB Avatar asked Nov 20 '10 22:11

JohnB


People also ask

How do I connect to data base in Visual Studio?

On the View menu, select Other Windows > Data Sources. In the Data Sources window, click Add New Data Source. The Data Source Configuration Wizard opens. Select Database on the Choose a Data Source Type page, and then select Next.


2 Answers

install the MySQL .NET Connector found here http://dev.mysql.com/downloads/connector/net/

alt text

like image 170
Jon Black Avatar answered Oct 16 '22 09:10

Jon Black


"Starting with version 6.7, Connector/Net will no longer include the MySQL for Visual Studio integration. That functionality is now available in a separate product called MySQL for Visual Studio available using the MySQL Installer for Windows."

Source: http://dev.mysql.com/downloads/connector/net/6.6.html

like image 32
Memet Olsen Avatar answered Oct 16 '22 10:10

Memet Olsen