连接字符串EF Asp.Net Identity

时间:2015-05-28 08:07:43

标签: c# asp.net entity-framework asp.net-identity

如何将以下连接字符串更改为EF连接。?

现在已经坐了很长时间并遇到各种错误,例如Keyword not supported: 'data source'.

这是我当前的连接字符串

<add name="DefaultConnection" connectionString="Data Source=(local);Initial Catalog=Portal;User ID=sa;Password=xxxx;MultipleActiveResultSets=True;" providerName="System.Data.EntityClient" />

IdentityModel

 public class ApplicationDbContext : IdentityDbContext<ApplicationUser>
{
    public ApplicationDbContext()
        : base("DefaultConnection")
    {
    }
}

}

1 个答案:

答案 0 :(得分:2)

您在连接字符串中指定了不正确的提供程序。将其更改为System.Data.SqlClient

<add name="DefaultConnection" 
     connectionString="Data Source=(local); ....."
     providerName="System.Data.SqlClient" />