应用程序配置文件中的连接字符串“MyConnection”不包含必需的providerName属性。 [英] The connection string 'MyConnection' in the application's configuration file does not contain the required providerName attribute."
本文介绍了应用程序配置文件中的连接字符串“MyConnection”不包含必需的providerName属性。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我使用实体框架代码首先
,
我的连接字符串在配置文件中:
My connection string is in a configuration file:
<connectionStrings>
<clear/>
<add name="ApplicationServices" connectionString="Data Source=PC-X;Initial Catalog=MYdb;Integrated Security=True"/>
</connectionStrings>
当我尝试访问数据(应该创建数据库的东西)会下降,出现以下错误:
When I try to access the data (something that should create the DB) is falling with the following error:
The connection string 'ApplicationServices' in the application's configuration file does not contain the required providerName attribute."
我缺少什么?
推荐答案
在 connectionString
属性(假设您使用SQL)之后,您缺少以下代码:
You're missing the following piece of code after the connectionString
attribute (assuming that you're using SQL):
providerName =System.Data.SqlClient
这篇关于应用程序配置文件中的连接字符串“MyConnection”不包含必需的providerName属性。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文