Code: Select all
public class SiteContext : DbContext
{
public SiteContext(DbConnection connection):base(connection, true)
{
connection.Open();
}
....
}
Code: Select all
public class HomeController : Controller
{
SiteContext _siteContext = new SiteContext(new MySqlConnection("server=localhost;User Id=myuser;database=mybase"));
...
Code: Select all
_siteContext.Database.Create();
---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.