重複
の可能性: SQL Server への接続の確立中に、ネットワーク関連またはインスタンス固有のエラーが発生しました。
今日、ログイン コントロールを使用して login.aspx と、ユーザーの作成ウィザードを使用して register.aspx の 2 つのページを作成しました ...
ローカル コンピューターで運用サーバーの接続文字列を使用すると、データベース ASPNETDB.MDF がローカル コンピューターの APP_Data フォルダーに存在する場合にのみサイトが機能します。
ASPNETDB.MDF の名前を変更するか、ローカル コンピュータの App_Data から ASPNETDB.MDF を削除すると、次のエラーが発生します...
An attempt to attach an auto-named database for file C:\Users\Ashish Dobriyal\Documents\Visual Studio 2008\WebSites\VOLVOO\App_Data\ASPNETDB.MDF failed. A database with the same name exists, or specified file cannot be opened, or it is located on UNC share.
しかし
ウェブページとデータベースを本番サーバーに公開した後、エラーが発生します....
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)
果たして何が問題だったのか…??
私の本番サーバー接続文字列:
<connectionStrings>
<remove name="ConnectionString"/>
<add name="ConnectionString" connectionString="workstation id=volvobusesindia.mssql.somee.com;packet size=4096;user id=username;pwd=password;data source=dobriyal.mssql.somee.com;persist security info=False;initial catalog=dobriyal" providerName="System.Data.SqlClient"/>
</connectionStrings>
私のローカルサーバーの接続文字列:
<connectionStrings>
<add name="ConnectionString" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\ASPNETDB.MDF;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient"/>
</connectionStrings>