本文介绍了C#记录集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
C#是否有一种方法可以从oracle中提取数据,然后关闭连接,但仍然可以遍历记录集.我知道必须使用OracleDataReader进行连接.
我这样做的唯一原因是因为我遇到此错误
Is there a way with C# to pull my data down from oracle and then close the connection but still be able to loop through the recordset. I know with a OracleDataReader the connection must be open.
The only reason i'm doing this is because i'm getting this error
System.IO.IOException未由用户代码处理 |
消息 = ``无法从传输连接读取数据:连接尝试失败,因为连接的一方在一段时间内未正确响应,或由于建立连接失败导致主机未建立连接. " |
来源 = " ; System'' |
StackTrace: |
在System.Net.Sockets.NetworkStream.Read(Byte []缓冲区,Int32偏移量,Int32大小) |
在System.IO.StreamReader.ReadBuffer() |
在System.IO.StreamReader.ReadLine() |
在DimpleSoftwares.ASPNET.Components.SmtpMailer.IsSMTPResponding(String smtpServer)中 |
在DimpleSoftwares.ASPNET.Components.EmailAddressValidator.Validate(String emailAddress)中 |
位于C:\ Inetpub \ wwwroot \ EmailTest \ EmailValidTest.aspx.cs:line 40中的EmailTest.EmailValidTest.Page_Load(Objectsender,EventArgse) tr> |
在System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp,Object o,Object t,EventArgs e) |
在System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender,EventArgs e)中 |
在System.Web.UI.Control.OnLoad(EventArgs e) |
在System.Web.UI.Control.LoadRecursive()处 |
在System.Web.UI.Page.ProcessRequestMain(BooleanincludeStagesBeforeAsyncPoint,BooleanincludeStagesAfterAsyncPoint) |
InnerException:System.Net.Sockets.SocketException |
消息 = "";由于连接的一方在一段时间内未正确响应而导致连接尝试失败,或者由于连接的主机未能响应'' |
来源 = 系统" |
错误代码 = 10060 |
NativeErrorCode = 10060 |
StackTrace: |
在System.Net.Sockets.Socket.Receive(Byte []缓冲区,Int32偏移量,Int32大小,SocketFlags,socketFlags) |
在System.Net.Sockets.NetworkStream.Read(Byte []缓冲区,Int32偏移量,Int32大小) |
InnerException: |
System.IO.IOException was unhandled by user code |
Message="Unable to read data from the transport connection: 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." |
Source="System" |
StackTrace: |
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size) |
at System.IO.StreamReader.ReadBuffer() |
at System.IO.StreamReader.ReadLine() |
at DimpleSoftwares.ASPNET.Components.SmtpMailer.IsSMTPResponding(String smtpServer) |
at DimpleSoftwares.ASPNET.Components.EmailAddressValidator.Validate(String emailAddress) |
at EmailTest.EmailValidTest.Page_Load(Object sender, EventArgs e) in C:\Inetpub\wwwroot\EmailTest\EmailValidTest.aspx.cs:line 40 |
at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) |
at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) |
at System.Web.UI.Control.OnLoad(EventArgs e) |
at System.Web.UI.Control.LoadRecursive() |
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) |
InnerException: System.Net.Sockets.SocketException |
Message="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" |
Source="System" |
ErrorCode=10060 |
NativeErrorCode=10060 |
StackTrace: |
at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags) |
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size) |
InnerException: |
推荐答案
这篇关于C#记录集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!