私は解決するために何日間も努力していますが、できませんでした。私はasp.net 4.0でカスタムメンバーシップとロールプロバイダを実装したWebアプリケーションを持っています。アプリのホームページを開くと、データベースに接続して情報を取得します。そこログインフォームでもあり、私がログインしたときには、データベースを介して、ユーザーを検証し、予約ページに私をリダイレクトしますが、このエラーよりも表示されます: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)
説明:
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です:
以下<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>
誰もいただきました!間違って把握することができますしてください?
プロジェクト内のすべての接続文字列を確認します。あなたが見ている可能性のあるconnectionStringだけでなく、正しいconnectionStringであるかもしれません。間違っているかもしれない別のconnectionStringかもしれません。プロジェクト内の "すべての接続文字列をチェック"してください。 – Jogi