Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to connect to a MySQL Data Source in Visual Studio 2012/2013 express on x64 bit machine

I have installed the Connector/Net for MySQL, but I still don't see them in Server explorer.

What should I do for see it ?

I can find files on my disk and etc. I also tried manually add description to machine.config for all framework versions

<system.data>
    <DbProviderFactories>
      <add name="Microsoft SQL Server Compact Data Provider 4.0" invariant="System.Data.SqlServerCe.4.0" description=".NET Framework Data Provider for Microsoft SQL Server Compact" type="System.Data.SqlServerCe.SqlCeProviderFactory, System.Data.SqlServerCe, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" />
      <add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory, MySql.Data, Version=6.7.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
    </DbProviderFactories>
  </system.data>
  <system.serviceModel>

but this is does't work.

No mySql Connector here

like image 560
Arbejdsglæde Avatar asked Oct 24 '13 09:10

Arbejdsglæde


1 Answers

My Soulution worked on VS 2013 Express.

For MySQL you do not need to use a Data Source. Please follow this procedure:

  • Install MySQL Connector/Net
  • Open your project
  • Go to Project > Add reference, Reference Manager window opens
  • Select Assembly > Extensions > MySql.Data.CF and press OK.
  • Use using MySql.Data.MySqlClient;

And your code works fine.

like image 134
Musa Haidari Avatar answered Oct 13 '22 08:10

Musa Haidari