Visual Studio Code Map: Unable to connect to the specified database

前端 未结 3 550
余生分开走
余生分开走 2020-12-31 09:51

I can\'t use Code Map in Visual Studio due to this error:

Unable to connect to the specified database.

An exception occurred attempting to

相关标签:
3条回答
  • 2020-12-31 10:12

    This worked for me:

    Delete, Create, Start localDB instance used by CodeMap:

    %localappdata%\Microsoft\Microsoft SQL Server Local DB\Instances\MSSQLLocalDB
    

    Using these commands:

    sqllocaldb stop "MSSQLLocalDB" -k
    sqllocaldb delete "MSSQLLocalDB"
    sqllocaldb create "MSSQLLocalDB" 
    sqllocaldb start "MSSQLLocalDB"
    

    Then restart VS

    0 讨论(0)
  • 2020-12-31 10:21

    Check out the difference between automatic and named (or private) LocalDb instances.

    The support files necessary for v11.0 (SQL Server 2012) are probably no longer installed on your system. v12.0 indicates SQL Server version 2014.

    0 讨论(0)
  • 2020-12-31 10:33

    Have you tried changing your database name? You can use something like (Look at your web.config file)

    <add name="DefaultConnection" connectionString="Data Source=YourDatasource;Initial Catalog=DatabaseNameAsYouWish;Integrated Security=SSPI" providerName="System.Data.SqlClient" />
    

    If you use sql management studio, you will find the Data Source Connection string while you are conntecting to database. Copy and paste it, then try again. If it works, let me know please.

    0 讨论(0)
提交回复
热议问题