问题描述
我有三个项目,第一个是Financial.Asst.core,第二个是Financial.Asst.Data,第三个是Financial.Asst.Web。
在第一个项目中App.config没有任何连接字符串。在第二个项目中,App.config具有以下连接字符串。
I have three projects 1st is Financial.Asst.core, 2nd is Financial.Asst.Data and 3rd is Financial.Asst.Web.
in first project's App.config not have any connection string. in second projects App.config has below connection string.
<div class="op">Quote:</div><connectionStrings>
<clear />
<add name="DefaultConnection" connectionString="Data Source=DESKTOP-J97B0AI;Initial Catalog=dada;Integrated Security=True" providerName="System.Data.SqlClient" />
</connectionStrings>
和第三个项目的web.config文件在连接字符串下面。
and third project's web.config file has below connection string.
<connectionStrings>
<add name="DefaultConnection" connectionString="Data Source=.\sqlexpress;Integrated Security=true;Initial Catalog=DESKTOP-J97B0AI;" providerName="System.Data.SqlClient" />
</connectionStrings>
所以,我一直试图运行解决方案,然后总是出现以下错误。 />
So, I am keep trying to run the solution then always getting following error.
建立连接时发生网络相关或特定于实例的错误到SQL Server。服务器未找到或无法访问。验证实例名称是否正确,以及SQL Server是否配置为允许远程连接。 (提供者:SQL网络接口,错误:26 - 错误查找指定的服务器/实例)
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)
所以请各位帮助我防止此问题。
我尝试了什么:
其中我启用了sqlserver和tcpIp服务。
so guys please help me to prevent from this issue.
What I have tried:
where i Enabled the sqlserver and tcpIp services.
推荐答案
这篇关于如何防止与SQL Server建立连接。服务器未找到或无法访问。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!