如何在带有实体框架的 MVC 中使用 SimpleMembership
我想在 MVC 3 网站中使用 SimpleMembership,但出现以下错误:
System.ArgumentException was unhandled by user code. Unable to find the requested .Net Framework Data Provider. It may not be installed.
我正在通过实体框架使用 SQL Server 数据库。这是我的连接字符串:
<add name="Database1Entities" connectionString="metadata=res://*/Models.Model1.csdl|res://*/Models.Model1.ssdl|res://*/Models.Model1.msl;provider=System.Data.SqlClient;provider connection string="data source=.\SQLEXPRESS;attachdbfilename=|DataDirectory|\Database1.mdf;integrated security=True;user instance=True;multipleactiveresultsets=True;App=EntityFramework"" providerName="System.Data.EntityClient" />
我已经在应用程序的其他部分使用 EF,因此该连接字符串是正确的并且我已连接到数据库。你能帮忙吗?
I want to use SimpleMembership in an MVC 3 website, but I'm getting the following error:
System.ArgumentException was unhandled by user code. Unable to find the requested .Net Framework Data Provider. It may not be installed.
I'm using a SQL Server database, through Entity Framework. Here is my connection string:
<add name="Database1Entities" connectionString="metadata=res://*/Models.Model1.csdl|res://*/Models.Model1.ssdl|res://*/Models.Model1.msl;provider=System.Data.SqlClient;provider connection string="data source=.\SQLEXPRESS;attachdbfilename=|DataDirectory|\Database1.mdf;integrated security=True;user instance=True;multipleactiveresultsets=True;App=EntityFramework"" providerName="System.Data.EntityClient" />
I already use EF in other parts of the application, so this connection string is correct and I have connection to the database. Can you please help?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我遇到了完全相同的问题。我发现的解决方法是取出连接字符串的“metadata=...”部分,然后仅放入连接字符串信息。我的外观与此类似:
希望有帮助!
I had the exact same problem. The work around I found was to take out that "metadata=..." part of the connection string and put in just the connection string information. My look similar to this:
Hope that helps!