Localdb connection from c# .net 3.5

2019-09-03 07:04发布

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?

1条回答
唯我独甜
2楼-- · 2019-09-03 07:42

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

查看更多
登录 后发表回答