从 adsDataReader 获取异常
我收到以下异常。表中有两条记录且HasRows = true
Advantage.Data.Provider.AdsException was unhandled by user code
Message="Error 5018: The handle given was not recognized by Advantage. Verify specified handle is open/active. The given handle is not recognized as a valid Advantage Client Engine handle."
Source="Advantage.Data.Provider"
Number=5018
State=""
StackTrace:
at Advantage.Data.Provider.AdsException.CheckACE(UInt32 ulRet)
at Advantage.Data.Provider.AdsDataReader.GetName(Int32 iCol)
at Ceridian.Benefits.AdvantageDbAdapter.Utilities.SelectBodyWriter.OnWriteBodyContents(XmlDictionaryWriter writer)
at System.ServiceModel.Channels.BodyWriter.WriteBodyContents(XmlDictionaryWriter writer)
at System.ServiceModel.Channels.BodyWriterMessage.OnWriteBodyContents(XmlDictionaryWriter writer)
at System.ServiceModel.Channels.Message.WriteBodyContents(XmlDictionaryWriter writer)
at Ceridian.Benefits.AdvantageDbAdapter.Utilities.AdapterMessage.OnWriteBodyContents(XmlDictionaryWriter writer)
at System.ServiceModel.Channels.Message.OnGetReaderAtBodyContents()
at Ceridian.Benefits.AdvantageDbAdapter.Utilities.AdapterMessage.OnGetReaderAtBodyContents()
at System.ServiceModel.Channels.Message.GetReaderAtBodyContents()
at System.ServiceModel.Dispatcher.OperationFormatter.DeserializeBodyContents(Message message, Object[] parameters, Boolean isRequest)
at System.ServiceModel.Dispatcher.OperationFormatter.DeserializeReply(Message message, Object[] parameters)
at System.ServiceModel.Dispatcher.ProxyOperationRuntime.AfterReply(ProxyRpc& rpc)
at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs)
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
InnerException:
I am getting the following exception. There are two records in the table and HasRows = true
Advantage.Data.Provider.AdsException was unhandled by user code
Message="Error 5018: The handle given was not recognized by Advantage. Verify specified handle is open/active. The given handle is not recognized as a valid Advantage Client Engine handle."
Source="Advantage.Data.Provider"
Number=5018
State=""
StackTrace:
at Advantage.Data.Provider.AdsException.CheckACE(UInt32 ulRet)
at Advantage.Data.Provider.AdsDataReader.GetName(Int32 iCol)
at Ceridian.Benefits.AdvantageDbAdapter.Utilities.SelectBodyWriter.OnWriteBodyContents(XmlDictionaryWriter writer)
at System.ServiceModel.Channels.BodyWriter.WriteBodyContents(XmlDictionaryWriter writer)
at System.ServiceModel.Channels.BodyWriterMessage.OnWriteBodyContents(XmlDictionaryWriter writer)
at System.ServiceModel.Channels.Message.WriteBodyContents(XmlDictionaryWriter writer)
at Ceridian.Benefits.AdvantageDbAdapter.Utilities.AdapterMessage.OnWriteBodyContents(XmlDictionaryWriter writer)
at System.ServiceModel.Channels.Message.OnGetReaderAtBodyContents()
at Ceridian.Benefits.AdvantageDbAdapter.Utilities.AdapterMessage.OnGetReaderAtBodyContents()
at System.ServiceModel.Channels.Message.GetReaderAtBodyContents()
at System.ServiceModel.Dispatcher.OperationFormatter.DeserializeBodyContents(Message message, Object[] parameters, Boolean isRequest)
at System.ServiceModel.Dispatcher.OperationFormatter.DeserializeReply(Message message, Object[] parameters)
at System.ServiceModel.Dispatcher.ProxyOperationRuntime.AfterReply(ProxyRpc& rpc)
at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs)
at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
InnerException:
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当获取阅读器和使用阅读器之间的底层连接关闭时,我通常会看到这种情况。如果您使用全局连接,请检查它是否在之前的某个地方被关闭。
例如,以下代码块将在“读取”时收到 5018 错误,因为连接已关闭。
如果移动 cn.Close();读完后你不应该得到错误。
I have typically seen this when the underlying connection was closed in between getting the reader and using the reader. If you are using a global connection check that it didn't get closed somewhere earlier.
For example the following code block will receive the 5018 error on the "read" since the connection was already closed.
If you move the cn.Close(); to after the read you should not get the error.