0

We created a windows application in .net 3.5. When i run it on my development machine (installed application, not from VS) i can connect to a local db database server using the servername: (localdb)\v11.0. When starting on the client's computer i get an exception when using this servername. When i use the named-pipe servername i can connect and query the databases.

On my development machine i can also connect to (localdb)\v11.0 from SSMS (Express) 2008 R2 SP2. This also does not work on the client's machine.

Anyone got any idee what is missing on the clients machine and is installed on my development machine?

Errormessage from SSMS:


Cannot connect to (localdb)\v11.0.


Er is een netwerkfout of een exemplaarspecifieke fout opgetreden tijdens het maken van verbinding met SQL Server. De server is niet gevonden of is niet toegankelijk. Controleer of de exemplaarnaam correct is en of in de instellingen van SQL Server externe verbindingen zijn toegestaan. (provider: SQL-netwerkinterfaces, error: 26 - Fout bij zoeken van opgegeven server/exemplaar) (.Net SqlClient Data Provider)


For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&EvtSrc=MSSQLServer&EvtID=-1&LinkId=20476


Error Number: -1 Severity: 20 State: 0

UPDATE:

When Executing the following query from management studio 2008 R2 SP2:

SELECT net_transport FROM sys.dm_exec_connections WHERE session_id = @@SPID;

The result: Named pipe

So Somehow SSMS knows to connect to the (localdb)\v11.0 using named pipes. When checking the propperties, the named-pipe name is also there and is somehow retrieved.

Normal SQL-Servers (local sqlexpress) return TCP when running the same query and also the servername is visibile when viewing the properties.

UPDATE 2:

Reading the recommended (see comments) post, there are more people who can connect using a .NET3.5 compiled program. I also found a lot of posts saying .net 4.0.3 is required. Since Windows 7 installs .net 4.5 by default, is it correct that i assume the .net 4.0.3 requirement is met?

UPDATE 3:###

2014-12-22: Meanwhile the product has been tested on several (user) PC. On most of the PC it functions as I would like it to function. Users can connect using the "(localdb)\v11.0" connection string. Even if Visual Studio 2012 is not installed.

Can it be an optional update from Microsoft which fixes the issue? And if so, which one?

Community
  • 1
  • 1
P. Zantinge
  • 185
  • 1
  • 15
  • 2
    Did your local database in client's pc created and started? – Prisoner Jul 02 '14 at 09:55
  • localdb is created by the current user and is running. I can connect using named pipes, but because the np-string is changed after every restart of localdb that is not the most user-friendly way. – P. Zantinge Jul 02 '14 at 10:18
  • 1
    I think the lowest .NET Framework version you can go is 4.0.2 http://blogs.msdn.com/b/sqlexpress/archive/2011/10/27/net-framework-4-now-supports-localdb.aspx Why it works for you I don't know, since the blog says *The version of SSMS is important as earlier versions are using .NET 3.5 and currently **only .NET 4 can be updated to understand LocalDB connection strings**.* – ta.speot.is Jul 02 '14 at 10:37
  • the latest update of the article you mention is 2012-01-03. I don't know, but i can imagine something has changed since then. Aslo, because i can connect from SSMS 2008 R2 SP2 i think there is. I just can't find out why i am able to do so. – P. Zantinge Jul 02 '14 at 13:27
  • as @ta.speot.is's comment, I did miss the title this topic is for .net 3.5, from [MSDN](http://msdn.microsoft.com/en-us/library/ms233817(v=vs.110).aspx), local db are supported after **.NET 4.0.2 / SQL Server 2008 R2**, that's maybe why you can connect from 2008 R2. Moreover, this post may help you: http://stackoverflow.com/questions/10540438/what-is-the-connection-string-for-localdb-for-version-11 – Prisoner Jul 03 '14 at 01:27
  • *because i can connect from SSMS 2008 R2 SP2 i think there is.* I'm not convinced. The fact that you *can* do it doesn't mean it's working properly. – ta.speot.is Jul 03 '14 at 01:28
  • @ta.speot.is: A late response. I don't know all functions are working as they should be. What i do know is the functions i like to use work on my development system, but not on a clients computer. – P. Zantinge Jul 07 '14 at 09:00

1 Answers1

0

Looks like its fixed in .Net 3.5 with this, but only if you have Visual Studio 2012 installed. http://support.microsoft.com/kb/2664825

I found a separate download here: http://thehotfixshare.net/board/index.php?showtopic=17253