Unable to determine the provider name...

Unable to determine the provider name...

Postby SpaceIQ » Thu 07 Apr 2011 20:06

Hi, I use the EF 4.1 in my ASP.NET MVC 3 project and the latest version of the Connect for MySQL Pro like:

Code: Select all
    public class SiteContext : DbContext
    {
        public SiteContext(DbConnection connection):base(connection, true)
        {
            connection.Open();
        }

        ....
    }


And have created the context:

Code: Select all
    public class HomeController : Controller
    {
        SiteContext _siteContext = new SiteContext(new MySqlConnection("server=localhost;User Id=myuser;database=mybase"));
...


After I have called the Create method:

Code: Select all
_siteContext.Database.Create();


And have got an exeption:

Unable to determine the provider name for connection of type 'Devart.Data.MySql.MySqlConnection'.


---

In web.config:

<system.data>
<DbProviderFactories>
<remove invariant="Devart.Data.MySql" />
<add name="dotConnect for MySQL" invariant="Devart.Data.MySql"
description="Devart dotConnect for MySQL"
type="Devart.Data.MySql.MySqlProviderFactory, Devart.Data.MySql,
Version=6.10.135.0, Culture=neutral, PublicKeyToken=09af7300eec23701" />
</DbProviderFactories>
</system.data>

In References:

Devart.Data
Devart.Data.MySql
Devart.Data.MySql.Entity
Devart.Data.MySql.Web

Also I called the License Information and made all steps of the wizard.

What is wrong? Thank you.
SpaceIQ
 
Posts: 2
Joined: Thu 07 Apr 2011 19:55

Postby guobin8205 » Fri 08 Apr 2011 08:13

<add name="dotConnect for MySQL" invariant="Devart.Data.MySql"
description="Devart dotConnect for MySQL"
type="Devart.Data.MySql.MySqlProviderFactory, Devart.Data.MySql,
Version=6.10.135.0, Culture=neutral, PublicKeyToken=09af7300eec23701" />

i found the type must be in one line.
guobin8205
 
Posts: 1
Joined: Fri 08 Apr 2011 08:08

Postby SpaceIQ » Fri 08 Apr 2011 08:52

Thank you very much. It works fine. :)
SpaceIQ
 
Posts: 2
Joined: Thu 07 Apr 2011 19:55


Return to dotConnect for MySQL