locked
Connection error using (LocalDB)\v11.0 ? RRS feed

  • Question

  • Hi,

    I have installed SQL 2012 and LocalDB on my development machine, and am able to connect to LocalDB using both the SQL Server Management tool 2012 and from within my winform application using a newly modifed connection string Shown below:

    Data Source=(LocalDB)\v11.0;AttachDbFilename=|DataDirectory|\MyDatabase.mdf;Integrated Security=True;Connect Timeout=60

    the problem arises when I attempt to port my appliation onto a Windows 2008 Server which is running SQL Server 2008,  ( I know I could skip the LocalDB installation and just make use of Sql 2008, but I am just testing the installation of my application on this machine.. )

    I have installed both SQL Server 2012 LocalDB and updated .net 4.01 to .net 4.02 using the kb article located at  http://support.microsoft.com/kb/2544514

    I keep getting getting an error when I attempt to connect to (LocalDB)\v11.0 from both my application and from the SQL Management 2008 Tool,  I have also manually started up (LocalDB)\v11.0 from cmd->SQLLocalDB -s "v11.0" and then attempted to connect once again using the NP

    i.e np:\\.\pipe\LOCALDB#8B2C7490\tsql\query 

    When I use thre named pipe everything connects fine,  so I am assuming that as this works then the installation of LocalDB is also correct.

    What do you suggest I do to resolve this situation? 

    I am also concerned as to the proper impllmentation moving forward with the deployment of my application,  am I supposed to now include .Net 4.03 as a prerequisite?  id so is there already a clickonce bootstrap manifest available for this or do I need to create one..so that my app works correctly moving forward,  I'm really concerned that LocalDB might break it.. as so far I'm not having much luck.. 

    I guess if all else fails I can go back to using Sql Express 2008 as this implmentation worked correctly before..

    Thanks,



    • Edited by robdob123 Monday, March 12, 2012 2:21 PM
    • Moved by Stephanie Lv Tuesday, March 13, 2012 1:31 AM (From:SQL Server Setup & Upgrade)
    Monday, March 12, 2012 2:04 PM

Answers

  • The box that I am accessing is a Win 2008 x86, It has Sql Server 2008 Standard Edtion installed.

    I have also installed the lastest .Net4.0.2 update as per the kb above,  and SQL 2012 LocalDB

    When I launch the SQlL 2008 SSMS and then try and access the LocalDB installation via (LocalDB)\v11.0 I'm not able to, however if I try and access ..

    according to this post http://blogs.msdn.com/b/sqlexpress/archive/2011/10/27/net-framework-4-now-supports-localdb.aspx SQL 2008 SSMS does not support LocalDB as .NET 4.0 is required and this SSMS version uses .NET 3.5

    • Marked as answer by robdob123 Wednesday, March 14, 2012 11:37 PM
    Wednesday, March 14, 2012 6:59 PM

All replies

  • Hi robdob123,

    It seems an SQL Server remote connection issue. Do you mean that the connection is successful while you enable the Named Pipes protocol on the remote instance? If that is the case, the reason to the failed connection might be that there is only Shared Memory protocol enabled on the remote instance, which cannot be used to remote connection.

    To enable the remote connection for a SQL Server instance, there are configurations you may need to apply. Please see: How to enable remote connections in SQL Server 2008? The configurations is also applied to SQL Server 2012. For a named instance, please make sure the SQL Server Browser is running and the UPD 1434 port is excluded from the firewall.

    If that does not work, please post the detail error information here for further troubleshooting.

    TechNet Subscriber Support
    If you are TechNet Subscription user and have any feedback on our support quality, please send your feedback here.


    Stephanie Lv

    TechNet Community Support



    Tuesday, March 13, 2012 6:34 AM
  • Hi,

    I am accessing the server via Remote Desktop connection, so once connected everything is local, I am not making any remote connection the the sql server

    The box that I am accessing is a Win 2008 x86, It has Sql Server 2008 Standard Edtion installed.

    I have also installed the lastest .Net4.0.2 update as per the kb above,  and SQL 2012 LocalDB

    My BIG concern and question I have is how do I get my winform connection string to work if (localDB)\v11.0 can't be accessed..

    I also no that there is nothing wrong with my connection string because it works perfectly on a another box where I have installed the Sql 2012 devloper package.  This is a deployemtn machine which I am having issues with and obviously concerned that I will have the same issues on othre client machines..

    When I launch the SQlL 2008 SSMS and then try and access the LocalDB installation via (LocalDB)\v11.0 I'm not able to, however if I try and access it via a named pipe then it works,  I open the names pipe via Start-Run->Cmd

    sqllocaldb -s v11.0

    sqllocaldb -i v11.0

    anyway my problem is that I cannot access the localdb using the (localDB)\v11.0 in either the 2008 SSMS or from within my Winform application which also uses the Data.sqlclient namespace.. 

    Tuesday, March 13, 2012 12:02 PM
  • robdob123,

    Could you please check that SQL Server named instance ‘(LocalDB)\v11.0’ is running on your local server? If it is running, you may have a try to attach this database by SQL Server Management Studio in case the database is not existed, and change the connection string as below to see if it works.

    Data Source=(LocalDB)\v11.0;Database=<databasename>;Integrated Security=True;Connect Timeout=60


    Stephanie Lv

    TechNet Community Support

    Wednesday, March 14, 2012 9:26 AM
  • The box that I am accessing is a Win 2008 x86, It has Sql Server 2008 Standard Edtion installed.

    I have also installed the lastest .Net4.0.2 update as per the kb above,  and SQL 2012 LocalDB

    When I launch the SQlL 2008 SSMS and then try and access the LocalDB installation via (LocalDB)\v11.0 I'm not able to, however if I try and access ..

    according to this post http://blogs.msdn.com/b/sqlexpress/archive/2011/10/27/net-framework-4-now-supports-localdb.aspx SQL 2008 SSMS does not support LocalDB as .NET 4.0 is required and this SSMS version uses .NET 3.5

    • Marked as answer by robdob123 Wednesday, March 14, 2012 11:37 PM
    Wednesday, March 14, 2012 6:59 PM
  • Hi,

    I've got the same problem.

    My program, compiled under FX 3.5, works with LocalDB using the "classic" connection string ((LocalDB)\.\MyInstance) on all OS except Windows 2008.

    This is true even if I install the 4.02 patch...you could say of course, because I'm under 3.5.

    If I use the Named Pipe version, it works on all OS.

    It seems that "Shared Instances" have a fixed Named Pipe that can be find in the registry (HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server Local DB\Shared Instances\MyInstance\InstanceName).

    Unfortunately, using the Named Pipe syntax, the instance is not started automaticly. The sqllocaldb start command must be launch before.

    Did you manage to make the "classic" syntax work on 2008?

    Monday, June 10, 2013 1:25 PM