I can't believe I couldn't find a working solution to this after an hour of searching. I'm following this article on Entity Framework 6.0 which gives a simple walk-through on Code First. I created the project and installed the latest EF Nuget package for the project to compile. I also verified that I have Microsoft SQL Server 2012 Express LocalDB installed which came with Visual Studio 2013. I don't have any other instances of SQL installed on my local computer. The program runs and entries are added to the database and outputted in the console. But when the article says "check your localdb" it doesn't say how! I don't see any '.mdf' or '.ldf' files created under the project folder. I tried every way to connect Visual Studio's Server Explorer to LocalDB. The wizard cannot locate (localdb) or cannot find any provider in Server Explorer to accept connection string like (localdb)\v11.0;Integrated Security=true; I've seen this asked several places in StackOverflow but no answer works or marked as answer. Please help, this doesn't have to be this frustrating!

连接Visual Studio服务器资源管理器到LocalDB的步骤是什么?


当前回答

https://aspblogs.blob.core.windows.net/media/dixin/Open-Live-Writer/89ee21b2c263_49AE/image_thumb_5.png Windows应用程序日志错误 计算机\HKEY_CURRENT_USER\软件\Microsoft\Microsoft SQL Server\UserInstances{2DD3D445-34C1-4251-B67D-7DFEED432A87}

只需将ParentInstance更改为MSSQL14E。LOCALDB或mssql15 .LOCALDB。

https://weblogs.asp.net/dixin/installing-sql-server-2017-2019-localdb-and-resolve-the-engine-versioning-problem?__r=8d90635095e1cd4

其他回答

选择在:

数据来源:Microsoft SQL Server (SqlClient) 服务器名称:(localdb)\MSSQLLocalDB 登录服务器:使用Windows身份验证

按Refresh按钮获取数据库名称:)

我遵循了上面的步骤,但我忘记在Visual Studio 2015配置之前安装SQL Server 2014 LocalDB。

我的步骤如下:

安装SQL Server 2014 LocalDB; 打开Visual Studio 2015和SQL Server对象资源管理器; 在SQL Server标记下找到您的LocalDB。

希望这对大家有所帮助。

以admin用户运行CMD。

from start menu 'cmd' - wait for it to find it. Right click on cmd, and select open as administrator type : cd C:\Program Files\Microsoft SQL Server\120\Tools\Binn type : SqlLocalDB start now type : SqlLocalDB info Shows the running sql instances available... choose what you want... to find more about the instance type : SqlLocalDB info instanceName now from VS you can setup your connection In VS, View/Server Explorer/(Right click) Data Connections/Add Connection Data Source: Microsoft SQL Server (SqlClient) Server name: (localdb)\MSSQLLocalDB Log on to the server: Use Windows Authentication Press "Test Connection", Then OK. job done

修理不起作用。

与示例插图中一样,所有这些步骤都只提供对“系统”数据库的访问,而没有选择要访问的现有用户数据库的选项。

访问本地(非Express Edition) Microsoft SQL server实例的解决方案驻留在SQL server端:

打开运行对话框(WinKey + R) 类型:“services.msc” 选择SQL Server浏览器 单击“属性” 将“禁用”改为“手动”或“自动” 当“Start”服务按钮启用时,单击它。

完成了!现在,您可以从连接属性中的“服务器名称”列表中选择本地SQL Server。

这对我很管用。

打开命令提示符 运行"SqlLocalDB.exe start" 输出说明"LocalDB instance "mssqllocaldb" started." 在VS中,查看/服务器资源管理器/(右键单击)数据连接/添加连接 数据来源:Microsoft SQL Server (SqlClient) 服务器名称:(localdb)\MSSQLLocalDB 登录服务器:使用Windows身份验证 按“测试连接”,然后确定。