I've been attempting to solve a significant problem for days, but I've been unsuccessful, so I need your assistance. My custom membership and role providers were implemented in an asp.net 4.0 web application. The app connects to the database and retrieves some data when I open the homepage. Additionally, there is a login form, and when I log in, it verifies my identity using the database before directing me to the reserved sites, but then this problem appears:
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)
Description:
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.
Exception Details:
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)
Source Error:
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.
I tried many things, some solution i found in stackoverflow but nothing worked. Here are my connectionstrings:
<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>
Below are also the membership and role manager web.config section:
<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>
Please can anybody tell me what am I doing wrong?