Localdb in Visual Studio 2015 error 52 (SQL Server)

ぐ巨炮叔叔 提交于 2020-01-02 23:54:38

问题


I programmed an application with an attached .mdf database file that works fine on my computer. But on another computer (client PC) I get this error message :

A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 52 - Unable to locate a Local Database Runtime installation. Verify that SQL Server Express is properly installed and that the Local Database Runtime feature is enabled.)] System.Data.SqlClient.SqlInternalConnection

Should I install SQL Server Express on my client PC? It's just impossible, can you please help ?

Thanks in advance


回答1:


If you want to use a .mdf SQL Server database file, you must install at least SQL Server Express on that machine - or put the database on a SQL Server instance in the network the PC is connected to and use the database on the server.

You cannot use a .mdf database file totally without installed SQL Server - SQL Server is not an embedded database that works without installation. If you require such a database, look at SQLite, SQL Server CE (Compact Edition) or something like RavenDB. Those can be embedded (as a set of DLL's) into your solution and work against files on disk without need of installing a server component on the machine where they run.



来源:https://stackoverflow.com/questions/36704628/localdb-in-visual-studio-2015-error-52-sql-server

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