无法连接到ASP.NET数据库



我不知道如何从ASP.NET MVC上的应用程序连接到我的SQL Server(本地(。

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: 26 - Error Locating Server/Instance Specified) 

连接到SQL SERVER(DbSettings.json(

{
"ConnectionStrings": {
"DefaultConnection": "Server=СМОЛЬКИНСЕРГЕЙ\SERVER;Database=Shop;Trusted_Connection=True;MultipleActiveResultSets=true"
}

}

通过ef迁移创建

EntityFrameworkCoreAdd-Migration initial 
EntityFrameworkCoreUpdate-DataBase 

在此处输入图像描述

我是新来的,不能理解的错误是什么

您是否尝试过如下更改连接字符串:

{
"ConnectionStrings": {
"DefaultConnection": "Data Source=СМОЛЬКИНСЕРГЕЙ\SERVER;Initial Catalog=Shop;Trusted_Connection=True;MultipleActiveResultSets=true"
}

注意"服务器"one_answers"数据库"更改为"数据源"one_answers"初始目录">

最新更新