东东小屋 2017-02-23 06:33 采纳率: 50%
浏览 1321

c#操作Vertica数据库时,无法访问已关闭的流

c#操作Vertica数据库时,打开多个页面偶尔会出现这个错误,无法访问已关闭的流

具体的代码位置是

da.Fill(ds);

da是VerticaDataAdapter

未处理System.ObjectDisposedException
HResult=-2146232798
Message=无法访问已关闭的流。
ObjectName=""
Source=mscorlib
StackTrace:
在 System.IO.__Error.StreamIsClosed()
在 System.IO.BufferedStream.Read(Byte[] array, Int32 offset, Int32 count)
在 Vertica.Data.Internal.IO.VStream.ReceiveIntegerR(Int32 siz)
在 Vertica.Data.Internal.IO.RowData.readNextColumn()
在 Vertica.Data.Internal.IO.RowData.readAll()
在 Vertica.Data.Internal.IO.DataRowResponseMessage.FinishReadRow()
在 Vertica.Data.Internal.IO.ProtocolStream.ReadMessage()
在 Vertica.Data.Internal.DataEngine.VResultSet.FetchChunk(Boolean clearExistingRowCache)
在 Vertica.Data.Internal.DataEngine.VResultSet.MoveToNextRow()
在 Vertica.Data.Internal.DataEngine.VResultSet.CloseCursor()
在 Vertica.Data.Internal.ADO.Net.SDataReader.Close()
在 Vertica.Data.Internal.ADO.Net.SDataReader.Dispose(Boolean disposing)
在 System.Data.Common.DbDataReader.Dispose()
在 System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
在 System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
在 System.Data.Common.DbDataAdapter.Fill(DataSet dataSet)
在 NHibernateVertica.VerticaDataHelper.FillDataTable(VerticaDataAdapter da, DataSet& ds, Boolean& isDone) 位置 F:\code\com.km.site\NHibernateVertica\VerticaDataHelper.cs:行号 224
在 NHibernateVertica.VerticaDataHelper.<>c__DisplayClass12_0.b__0() 位置 F:\code\com.km.site\NHibernateVertica\VerticaDataHelper.cs:行号 160
在 System.Threading.ThreadHelper.ThreadStart_Context(Object state)
在 System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
在 System.Threading.ThreadHelper.ThreadStart()
InnerException:

  • 写回答

1条回答 默认 最新

  • threenewbee 2017-02-23 08:14
    关注

    检查你的代码,你是否不正确使用了 close 或者 dispose/using ,导致访问的流对象已经关闭了。

    评论

报告相同问题?

悬赏问题

  • ¥100 Jenkins自动化部署—悬赏100元
  • ¥15 关于#python#的问题:求帮写python代码
  • ¥20 MATLAB画图图形出现上下震荡的线条
  • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘
  • ¥15 perl MISA分析p3_in脚本出错
  • ¥15 k8s部署jupyterlab,jupyterlab保存不了文件
  • ¥15 ubuntu虚拟机打包apk错误
  • ¥199 rust编程架构设计的方案 有偿
  • ¥15 回答4f系统的像差计算
  • ¥15 java如何提取出pdf里的文字?