I can't get a Sql Server localdb connection to work on a computer that does not have SqlServer Express installed

风格不统一 提交于 2019-12-03 02:22:26

The problem was related to having Sql Server Express LocalDB 2014 installed instead of 2012. With that version MS has changed the connection string requirements. Instead of Data Source=(LocalDB)\V11.0, the connection string is Data Source=(LocalDB)\MSSQLLocalDB. After changing my connection string the program is running correctly on a computer that only has the LocalDB 2014 installed. Here is a link to an article about it: https://connect.microsoft.com/SQLServer/feedback/details/845278/sql-server-2014-express-localdb-does-not-create-automatic-instance-v12-0

also

http://msdn.microsoft.com/en-us/library/hh510202(v=sql.120).aspx

Using "Data Source=(LocalDB)\MSSQLLocalDB" also not worked form me. I had to access databasseusing "Data Source=(LocalDB)\V12.0" and for working that access to work I needed to run this command first "sqllocaldb create "v12.0". More details on this link https://dyball.wordpress.com/2014/04/28/sql-2014-localdb-error-cannot-connect-to-locaidbv12-o/

You'll want to make sure that you've installed .NET Framework 4.0 and, equally as importantly, the .NET Framework 4.0.2 update (KB #2544514).

Once your system is up to date, you can download the SqlLocalDb installer from:

http://www.microsoft.com/en-us/download/details.aspx?id=29062

The build having connection string of (LocalDB)\v11.0 will work with the localDB ENU\x64\SqlLocalDB.MSI given on this link Download SqlLocalDB

I tried this on target system where no Visual Studio is installed. This build will connect with the database with only SqlLocalDB.msi installed. There is no need to install SqlExpress on target system.

The problem is when you have both Visual Studio 2013 and Visual Studio 2017 there are two versions of loacal database installed.

Visual Studio 2013 - (localdb)\v11.0 Microsoft SQL Server 2012 (SP1) - 11.0.3000.0 (X64) Oct 19 2012 13:38:57 Copyright (c) Microsoft Corporation Express Edition (64-bit) on Windows NT 6.2 (Build 9200: )

Visual Studio 2017 - (localdb)\MSSQLLOCALDB Microsoft SQL Server 2016 (SP1) (KB3182545) - 13.0.4001.0 (X64) Oct 28 2016 18:17:30 Copyright (c) Microsoft Corporation Express Edition (64-bit) on Windows 10 Pro 6.3 (Build 17134: )

Before installing Visual Studio 2017 I was able to connect to (localdb)\v11.0, but after installing Visual Studio 2017 I am not able to connect to previous version of SQL Express (localdb)\v11.0, but I am able to connect to (localdb)\MSSQLLOCALDB using C#. I am able to connect to both of them from SQL Server Management Studio without any issues.

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