i tried to connect to localdb with vs 2019 and i couldn't find any solution

Budour AlHarbi 21 Reputation points
2021-07-06T15:55:51.43+00:00

TITLE: Connect to Server

------------------------------

Cannot connect to (localdb)\V11.0.

------------------------------

ADDITIONAL INFORMATION:

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: 56 - Unable to load the SQLUserInstance.dll from the location specified in the registry. Verify that the Local Database Runtime feature of SQL Server Express is properly installed.) (Microsoft SQL Server, Error: 126)

For help, click: https://learn.microsoft.com/sql/relational-databases/errors-events/mssqlserver-126-database-engine-error

------------------------------

The specified module could not be found

------------------------------

BUTTONS:

OK

------------------------------

Azure SQL Database
SQL Server | Other
{count} votes

Accepted answer
  1. Seeya Xi-MSFT 16,661 Reputation points
    2021-07-07T03:09:53.107+00:00

    Hi @Budour AlHarbi ,

    You can have a look at this thread, which may be a similar issue.

    Steps to connect LocalDB to Visual Studio Server Explorer:
    Open command prompt
    Run SqlLocalDB.exe start v11.0
    Run SqlLocalDB.exe info v11.0
    Copy the Instance pipe name that starts with np:...
    In Visual Studio select TOOLS > Connect to Database...
    For Server Name enter (localdb)\v11.0. If it didn't work, use the Instance pipe name that you copied earlier. You can also use this to connect with SQL Management Studio.
    Select the database on next dropdown list
    Click OK
    For more information, please refer to this:https://stackoverflow.com/questions/21563940/how-to-connect-to-localdb-in-visual-studio-server-explorer

    Best regards,
    Seeya


    If the response is helpful, please click "Accept Answer" and upvote it, as this could help other community members looking for similar queries.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


1 additional answer

Sort by: Most helpful
  1. Erland Sommarskog 122K Reputation points MVP Volunteer Moderator
    2021-07-06T22:06:40.44+00:00

    Could you give us some information why you expect this to work?

    It seems from the error message that you don't have localdb installed. Is this something you can verify or refute?

    If you have localdb installed, have you created an instance called v11.0? If you run

    sqllocaldb info
    

    what do you see?


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.