有时我尝试使用ase客户端打开与sybase的连接时出现以下错误
与Sybase服务器的连接已丢失 . 已回滚所有活动事务堆栈跟踪:Sybase.Data.AseClient1.AseCommand.CheckResult(Int32 res),位于Sybase.Data.AseClient.AseCommand.ExecuteDbDataReader(CommandBehavior)上的Sybase.Data.AseClient1.AseCommand._ExecuteReader(CommandBehavior commandBehavior)在System.Data.Common.DbDataAdapter.FillInternal(DataSet数据集,DataTable [] datatables,Int32 startRecord,Int32 maxRecords,String srcTable,System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior)中的行为) System.Data.Common.DbDataAdapter.Fill(DataSet dataSet)中的System.Data.Common.DbDataAdapter.Fill(DataSet dataSet,Int32 startRecord,Int32 maxRecords,String srcTable,IDbCommand命令,CommandBehavior行为)中的IDbCommand命令,CommandBehavior行为)
我正在使用dll Sybase.AdoNet2.AseClient (64 bit) version 2.155.1015.0
我的代码如下
AseConnection Connection = new AseConnection("ConnectionString");
AseCommand Command = new AseCommand("StoredProcedure", Connection);
Command.CommandType = CommandType.StoredProcedure;
AseDataAdapter adapter = new AseDataAdapter();
DataSet ds = new DataSet();
adapter.SelectCommand = Command;
adapter.MissingSchemaAction = SchemaAction;
adapter.Fill(ds);
此代码在IIS Web服务下运行
搜索不会导致有用的东西,我得到的是this link,但没有帮助
1 回答
找不到任何有关此缺陷的解决方案或其根本原因,所以我开发了刚捕获此异常,然后重试连接和命令执行