christian_chr
christian_chr

Reputation: 77

Error when trying to add a local database to c# project in VS2015

I will explain what i've done: - Installed windows 10 - Installed lan/graphic/motherboard drivers - Installed chrome / visual studio 2015 / Sql server 2014 / sqllocaldb

I opened visual studio 2015, created a new C# project, did some coding, irrelevant to the question, and then i clicked on Project -> Add new item -> Service-based local database and i get the following error :

A network-related or instance-specific error occured 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 50- Local database runtime error occured. The specified LocalDB does not exist.)

I tried some fixes i have found on the internet but none have worked. Has anyone got any clue what it might be?

Upvotes: 1

Views: 361

Answers (2)

christian_chr
christian_chr

Reputation: 77

Actually it seems i figured it out You have to create an instance of sqllocaldb by: - Starting command prompt - type : sqllocaldb create "instance name" (replace instance name with something) - open visual studio -> tools -> options ->database -> instance name -> change to "(localDB)\your instance"

Upvotes: 1

Edwards Moses
Edwards Moses

Reputation: 108

Probably restart your system, the error might stop, or if that does not work, try this,

  • Uninstall SQL Server, and Install it again.

Upvotes: 0

Related Questions