There isn't much point in asking the question. Always close/dispose
your disposable objects. Always. :-)
If for purely educational reasons you want to know the answer of what
happens when you don't dispose a reader and instead dispose the
connection, you have to get more specific. The behavior could vary
depending on which reader--mssql, oledb, oracle, sybase, sqlite,
mysql, and on and on. I know for sure that the SQLite implementation
has a lot of code in it to handle this situation and will close
readers, but it's 'cause the author is extremely forgiving to bad
developers that don't close their disposable objects.
Sam
------------------------------------------------------------
We're hiring! B-Line Medical is seeking .NET
Developers for exciting positions in medical product
development in MD/DC. Work with a variety of technologies
in a relaxed team environment. See ads on Dice.com.
On Tue, 18 Sep 2007 14:14:46 -0700, "Daniel"
<so*******************@yahoo.comwrote:
>is a reader automaticaly disposed if the connection it is associated with is
closed?
what will happen if an app:
while true
open connection
open reader
close connection
end while