1
我有EF6一個簡單的控制檯應用程序,我的電腦有的LocalDB V13,當我嘗試連接到EF數據庫,我得到這個錯誤EF6用的LocalDB V13底層連接未能打開
{"Cannot open database \"NinjaDomain.DataModel.NinjaContext\" requested by the login. The login failed.\r\nLogin failed for user 'xx\\xx.yy'."}
這是在app.config
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
</startup>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
<parameters>
<parameter value="mssqllocaldb" />
</parameters>
</defaultConnectionFactory>
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
</providers>
</entityFramework>
</configuration>
我是管理員在sql server本地db btw ... –
C:\ WINDOWS \ system32> sqllocaldb.exe創建 La instancia「MSSQLLocalDB」de LocalDB secreócon laversión13.0.1100.286。 –
在AppData –