Re: Need to close DataReader?
Tech-Archive recommends: Fix windows errors by optimizing your registry
One way to deal with this is to use the CloseConnection commandbehavior. In
the old days, you needed to close the connection for another reader to use
it. Now with MARS this isn't the case but that doesn't mean you want to
leave it open. When you've retrieved all the records, you want to make sure
the reader is closed. The most important thign to close is the connection
although the DAAB handles this.
"ad" <flying@xxxxxxxxxxxxxxx> wrote in message
news:OVSpBvDMGHA.2992@xxxxxxxxxxxxxxxxxxxxxxx
If it need to close DataReader after read?
I am study the Data Access Application Block for .Net Framework2.0 form
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnpag2/html/entlibjan2006_dataaccessappblock.asp
I found the the DataReaders in the examples are not close explicitly in
program.
Dose it need to close DataReader after read?
.
Relevant Pages
- Re: garbage collection
... are done with the reader and are ready to close it. ... The best practice when returning a SqlDataReader from a method is to ... The above ensures that the underlying database connection is closed ... >>> closed all the connections and datareaders and the app works great.. ... (microsoft.public.dotnet.framework.aspnet) - Three Phases To Email Sensitivity
... the associationphase, the connection phase, and the ... They should have the right words thatthe reader can transform back ... When writing your response, you willwant to make ... If the topic is about apples, you donot want to add an orange ... (comp.lang.vhdl) - Re: garbage collection
... You can not return reader after the connection is closed. ... But to return a dataReader you need to keep the connection open. ... Also, If your application>> doesnt allow database connection pooling, you need to dispose your> database ... (microsoft.public.dotnet.framework.aspnet) - Re: CommandBehavior.CloseConnection question
... > When you close the reader, the connection is closed if you use ... Dim dbReader as SqlDataReader ... Dim ConnectionString as String ... (microsoft.public.dotnet.framework.adonet) - Re: Multi-threaded apps and data readers
... RightHand .NET consulting & development www.rthand.com ... Blog: http://cs.rthand.com/blogs/blog_with_righthand/ ... So if I kept the connection open all ... commands reader, how would I prevent the readers from clashing or do ... (microsoft.public.dotnet.framework.adonet) |
|