c#代碼如下
DbConnection connection = providerFactory.CreateConnection();
DbCommand command = providerFactory.CreateCommand();
connection.ConnectionString = ConnectionString;
command.CommandText = sql;
command.CommandType = commandType;
command.Connection = connection;
try
{
command.Connection.Open();
using (DbDataReader reader = command.ExecuteReader())//這里報例外
{.....此處省略.....}
}catch(Exception ex){....}
finally
{
try { if (command.Connection != null)command.Connection.Close(); }
catch (Exception) { }
}
oracle在本地連接一直沒有問題,后來因oracle太卡,所以弄了遠程的服務器(無線路由)結果經常大約在3分鐘左右不進行資料庫操作的話,就會產生例外ORA-a03113: end-of-file on communication channel,
注意:是例外,而不是重連造成的慢,實在是讓人郁悶.
并且在重繪一到兩次后則會成功連接,并可操作資料庫
uj5u.com熱心網友回復:
引發的例外:“System.Net.Sockets.SocketException”(位于 System.dll 中)您好,這是我遇到的例外,請問您知道解決方法嗎? 能提供下您QQ嗎,我QQ 805228422謝謝您了
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/69678.html
標籤:開發
上一篇:作業創建失敗
