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)
描述:
An unhandled exception occurred during the execution of the current
web request. Please review the stack trace for more information about
the error and where it originated in the code.
例外详情:
System.Data.sqlClient.sqlException: 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)
源错误:
An unhandled exception was generated during the execution of the
current web request. Information regarding the origin and location of
the exception can be identified using the exception stack trace below.
我尝试了很多东西,我在stackoverflow中发现了一些解决方案,但没有任何工作。这是我的连接字符串:
<connectionStrings> <clear/> <remove name="LocalsqlServer"/> <add name="LocalsqlServer" connectionString="Data Source=MSsql2008-1;Initial Catalog=agency; Integrated Security=False;User ID=adis_agency;Password=niarda2012;Connect Timeout=180;Encrypt=False; Packet Size=4096" providerName="System.Data.sqlClient" /> <add name="AgencyConn" connectionString="Data Source=MSsql2008-1;Initial Catalog=agency; Integrated Security=False;User ID=adis_agency;Password=niarda2012;Connect Timeout=180;Encrypt=False; Packet Size=4096" providerName="System.Data.sqlClient"/> </connectionStrings>
以下也是会员和角色管理器的web.config部分:
<membership defaultProvider="AuthProvider"> <providers> <clear/> <add name="AuthProvider" type="AuthenticationProvider" applicationName="~/Reserved/" connectionStringName="AgencyConn"/> </providers> </membership> <roleManager enabled="true" defaultProvider="MyRoleProvider"> <providers> <clear/> <add name="MyRoleProvider" type="RoleAccessProvider" connectionStringName="AgencyConn"/> </providers> </roleManager>
请问有谁能帮忙弄清楚出了什么问题?