2011-07-23 20 views
2

私はasp.netでWebアプリケーションを設計しました...私はウェブサイトを公開しました.. 私は仮想ディレクトリを作成し、公開ファイルをコピーしました.... とウェブサイトを参照してください。asp.netでの公開エラー

An error has occurred while establishing a connection to the server. When connecting to >SQL Server 2005, this failure may be caused by the fact that under the default settings >SQL Server does not allow remote connections. (provider: Named Pipes Provider, error: 40 >- Could not open a connection to SQL Server) 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: An error has occurred while >establishing a connection to the server. When connecting to SQL Server 2005, this >failure may be caused by the fact that under the default settings SQL Server does not >allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a >connection to SQL Server)

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.

+0

http://msdn.microsoft.com/en-us/library/dd483479.aspx –

答えて

0

WebサイトがSQL Serverに接続しようとしましたが、接続文字列が一致しません。ホストされているサーバーに応じて、Webサイトweb.configの接続文字列を変更する必要があります。

web.configを開き、接続文字列の設定を変更します。あなたは、SQLサーバーに2005.Oneより多くの事を使用している場合は、公開ウェブサイトをアップロードしているときは、接続文字列を変更し、uidとパスワードを提供する必要が

<connectionStrings> 
<add name="DBName" providerName="System.Data.SqlClient" connectionString="uid=; pwd=; database=; server=;Max Pool Size=500"/> 
</connectionStrings> 
+0

私は仮想ディレクトリ内のコピーファイルを持っています..ウェブ設定ファイルの仮想ディレクトリ内のダイレクトファイル変更? – Malliga

+0

はい、サーバーweb.configで直接ホスティングサーバーに応じて接続文字列情報を変更する必要があります。 –

+0

通常、私のWeb configファイルの<のconnectionStrings> <= "PhotostudioConnectionString" れたconnectionString =名前を追加し、 "データソース= .;初期カタログ= PhotoStudioは、統合セキュリティ= True" を providerNameで= "System.Data.SqlClientの" />変更する方法 – Malliga

0

はbinフォルダからDLLを追加

0

このエラーがあるかもしれませんいくつかの理由が原因です。

1 - 接続文字列が正しいことを確認してください。あなたはhere for more info.

2を確認することができます - プロパティは、あなたのSQL Server上のオプション「
TCP/IPおよび名前付きパイプの両方を使用する」にチェックされているあなたは、「ローカルおよびリモート接続」を持っていることを確認してください。

3 - ファイアウォールが要求をブロックしていないことを確認してください。

4 - コンピュータでSQL ServerおよびSQL Server Browserサービスが開始されていることを確認します。

関連する問題