4
votes

I'm having the following problem.

I have Visual Web Developer 2010 Express and I'm trying to get it to work with the Entity Framework and a MySQL database.

I have the .NET Connector for MySql installed, but it doesn't seem to integrate with Web Developer, as it does with Visual Studio 2010 (professional edition). The wizard for creating the ADO.NET Entity Data Model asks me for the data to connect to the database, but I can't choose the MySql driver, so I can't create a connection, so in short, I can't continue.

Things I've tried so far:

1) I have referenced MySql.Data, MySql.Web and MySql.Data.Entity in my project, but to no avail.

2) I have manually created a connection string in my Web.config like so:

<connectionStrings>
  <add name="modelEntities" connectionString="metadata=res://*/Model.csdl|res://*/Model.ssdl|res://*/Model.msl;provider=MySql.Data.MySqlClient; provider connection string='server=localhost;User Id=simply; database=simply;password=simply'" providerName="System.Data.EntityClient"/
</connectionStrings>

At the same time, I have also added following code:

<system.data>
    <DbProviderFactories>
        <clear />
        <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.3.6.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d"/>
    </DbProviderFactories>
</system.data>

3) I have changed the previous connection string into a normal connection string like so:

<add name="connection" connectionString="server=localhost;database=simply;uid=simply;password=simply" providerName="System.Data.EntityClient"/>

4) I have added following code to my machine.config (and rebooted the computer):

<DbProviderFactories>
  <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.3.6.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" />
</DbProviderFactories>

All of this has been to no avail so far. Can anyone point me in the right direction and explain to me how I'm supposed to get my Entity Framework with MySql up and running?

Thanks a lot for any help you guys can give me.

1
Hello @Steven, quick clarification, it works in vs2010 Pro, but not in Web Dev? In my config, I don't have dbProviderFactories and my string looks like this: <add name="testdbDB" connectionString="metadata=res://*/testdbAdo.csdl|res://*/testdbAdo.ssdl|res://*/testdbAdo.msl;provider=MySql.Data.MySqlClient;provider connection string=&quot;server=localhost;User Id=********;password=********;Persist Security Info=True;database=testdb&quot;" providerName="System.Data.EntityClient"/>. have you tried these: install, connect - mateuscb
Hello. Yes. At my work, we've got VS2010 pro, and it works like a charm there. I've only got Web Dev here. I have tried both of your links, but it didn't work. The first link expects the .NET connector to appear, but it doesn't - like Devart commented, this is supposed to be designed behavior because Web Dev doesn't allow 3rd party extensibility. The second link unfortunately has the same problem. But thanks for thinking along. If you've got any other tips/ideas, please let me know. - Steven Lemmens
no problem. Looks like its a bit tougher than I imagined. The links from @Devart seem hopeful. Best of luck. If I come across anything else, will post. - mateuscb

1 Answers

4
votes

This is the designed behaviour - VS does not allow 3rd party extensibility in Express versions.
We have provided some piece of advice here at our forum.
You can try to achieve the same results using edmgen as well.