EF之数据库连接问题The specified named connection is either not found in the configuration, not intended to b...

Entity Framework项目自动生成的edmx文件的连接字符串的问题

1.首先修改<add name="NorthWindEntities"        connectionString="metadata=res://*/NorthWind.csdl|res://*/NorthWind.ssdl|res://*/NorthWind.msl;provider=System.Data.SqlClient;provider connection string=&quot;    fData Source=127.0.0.1;Initial Catalog=NorthWind;Persist Security Info=True;User ID=sa;Password=123456;MultipleActiveResultSets=True&quot;"  providerName="System.Data.EntityClient" />

2.若是出现以下异常则说明执行程序所在的项目没有引用到该连接字符串

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

一般是连接字符串所在的App.Config的问题,他必须出现在执行程序所在的那个Web.Config 或者是 App.Config

参考:MSDN

转载于:https://www.cnblogs.com/senion/archive/2011/04/19/2020379.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值