|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Need to close DataReader?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? 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. Show quote "ad" <fly***@wfes.tcc.edu.tw> wrote in message news:OVSpBvDMGHA.2992@tk2msftngp13.phx.gbl... > 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? > > |
|||||||||||||||||||||||