实体框架错误 [英] Entity Framework Error

查看:59
本文介绍了实体框架错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的项目中使用Entity Framework,但出现了这样的错误

在配置中找不到指定的命名连接,或者不打算与EntityClient提供程序一起使用,或者无效.

在app.config文件中

i am using Entity Framework in my project but i am getting error like this

The specified named connection is either not found in the configuration, not intended to be used with the EntityClient provider, or not valid.

in app.config file

<configuration>
  <connectionStrings>
    <add name="NorthwindEntities" connectionString='metadata=res://*/NorthwinEntities.csdl|res://*/NorthwinEntities.ssdl|res://*/NorthwinEntities.msl;provider=System.Data.SqlClient;provider connection string=&quot;data source=TRIOM;initial catalog=Northwind;integrated security=True;multipleactiveresultsets=True&quot;' providerName="System.Data.EntityClient" />
  </connectionStrings>
</configuration>



请帮助我

谢谢.



please help me

thank you.

推荐答案

我看到标签为asp.net,因此,我假设您正面临asp.net Web应用程序中的此问题.如果是这种情况,您上面引用的App.config必须是带有EDMX文件所在项目的自动生成的文件.
我建议您复制整个< connectionstrings>节点并将其放置在您的web.config中.
I saw the tag as asp.net, hence I am assuming you are facing this problem from an asp.net web application. If that is the case, the App.config you are referring above must be the auto generated file with the project where the EDMX file resides.
I suggest you copy the whole <connectionstrings> node and place it in your web.config.


这篇关于实体框架错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆