0

別の外部データベースサーバーで実行されている、PervasiveDBと対話するASP.NETMVCアプリケーションを開発しています。次のような接続文字列でPervasiveADO.NETデータプロバイダーを使用します。ServerDSN=dbname;UID=user;PWD=password;ServerName=87.xxx.xx.xxx; 開発マシンでは、IIS Expressでデバッグしている間はすべて問題ありませんが、IIS 7.0を実行するリモートホスティングサーバーにアプリを展開すると、dbに接続しようとすると例外が発生します。

コード:

PsqlConnection conn = new PsqlConnection(ConnectionString);
conn.Open();
try
{
  PsqlCommand cmd = new PsqlCommand(query);
  cmd.Connection = conn;
  PsqlDataReader reader = cmd.ExecuteReader();
  while (reader.Read())
  {
    ...
  }
}
finally
{
  conn.Close();
}

例外:

2013-01-28 15:40:21.2574|ERROR|App.WebApiApplication|Pervasive.Data.SqlClient.PsqlException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond 87.xxx.xx.xxx:1583 at Pervasive.Data.SqlClient.PsqlConnection.Open() at App.DBFacade.TestConnection() at App.WebApiApplication.Application_Start()

ホスティングサーバーからデータベースサーバーへのpingはOKです。

開発環境と本番環境の違いがわかりません。このエラーを修正するにはどうすればよいですか。

4

1 に答える 1

0

このエラーの原因は、ホスティングプロバイダーが特定のIPとポートで接続をブロックしたことです。

于 2013-01-29T13:54:55.197 に答える