My suggestion is to never send an IDataReader to the presentation layer.
But you need to close it.
IDataReader idr = //Something to get it
try
{
//do something with it
}
finally
{
if(null!=idr)
{
idr.Close();
}
}
See my blog
http://sholliday.spaces.live.com/?_c...26ayear%3d2006
On using an IDataReader in the business logic layer, and passing a Custom
Collection to the Presentation Layer.
"???? ???????" <@discussions.microsoft.comwrote in message
news:B5**********************************@microsof t.com...
Hi,
In few places within my code
the business object pass IDataReader to the GUI.
Suddenly i noticed that nowhere in the code the IDataReader
is being closed.
Does the data binding operation closes the IDataReader?
If i didn't close it explicitly, the IDataReader remains open untill GC
will
clean it?
Thanks.