简体   繁体   中英

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?

实际上,似乎我知道了,您必须通过以下方式创建sqllocaldb的实例:-启动命令提示符-类型:sqllocaldb创建“实例名称”(用某些内容替换实例名称)-打开Visual Studio->工具->选项->数据库->实例名称->更改为“((localDB)\\您的实例”

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

  • Uninstall SQL Server, and Install it again.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM