Keyword not supported: “data source” initializing Entity Framework Context

不想你离开。 提交于 2019-11-27 06:30:54

The real reason you were getting this error is because of the " values in your connection string.

If you replace those with single quotes then it will work fine.

http://blogs.msdn.com/b/rickandy/archive/2008/12/09/explicit-connection-string-for-ef.aspx

(Posted so others can get the fix faster than I did.)

I fixed this by changing EntityClient back to SqlClient, even though I was using Entity Framework.

So my complete connection string was in the format:

<add name="DefaultConnection" connectionString="Data Source=localhost;Initial Catalog=xxx;Persist Security Info=True;User ID=xxx;Password=xxx" providerName="System.Data.SqlClient" />

This appears to be missing the providerName="System.Data.EntityClient" bit. Sure you got the whole thing?

Believe it or not, renaming LinqPad.exe.config to LinqPad.config solved this problem.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!