EF之数据库连接问题The specified named connection is either not found in the configuratio
时间:2011-04-19 来源:萧飒
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=" fData Source=127.0.0.1;Initial Catalog=NorthWind;Persist Security Info=True;User ID=sa;Password=123456;MultipleActiveResultSets=True"" 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
相关阅读 更多 +