Issue creating DbContext connection with LINQPad using Entity Framework 6.0 code first

时间秒杀一切 提交于 2020-01-04 15:29:19

问题


I'm using LINQPad v4.51.03 and attempting to create a DbContext connection from a code-first implementation in Entity Framework 6.0 (6.1.1).

public partial class MyEntities : DbContext    
{    
    public MyEntities() : base("mydbname") { ...

The connection string looks like:

<add name="mydbname" connectionString="Data Source=<db>;initial catalog=<cat>;integrated security=True;multipleactiveresultsets=True;application name=EntityFramework" providerName="System.Data.EntityClient" />

In the LINQPad 'Add connection' wizard everything seems to set up correctly when attempting to create a DbContext connection (using the parameter-less constructor) until I click test, at which point I receive the following error: "Error: Keyword not supported: 'data source'".

I'm guessing EF 6.0 no longer supports that type of connection string (even though it still works). How would I create the LINQPad connection for code-first implementations?

来源:https://stackoverflow.com/questions/27627215/issue-creating-dbcontext-connection-with-linqpad-using-entity-framework-6-0-code

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