DataView vs DataReader
From: Mark (mark_at_Z-Zvolution.nZt)
Date: 09/09/04
- Previous message: Frank Mamone: "Re: How are static variables handled in asp.net"
- Next in thread: Marina: "Re: DataView vs DataReader"
- Reply: Marina: "Re: DataView vs DataReader"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 10 Sep 2004 08:51:40 +1000
Hi all, quick question [Please correct me where I am wong ;)], a DataView is
memory resident "view" of data in a data table therefore once populated you
can close the connection to the database. Garbage collection can then be
used to "clean up" the DataView once it is not referenced and will not
effect the number of connections to the database.
A DataReader on the other hand always maintains a connection to the database
and must be explicitly closed (Do not rely on garbage collection).
Reason I am asking is that I have been give a heap of vb.net code and there
are numerous functions that return a DataReader (Causing all sorts of SQL
Timeout headaches, maximum connections reached etc). To solve this problem
in the quickest amount of time I am thinking of replacing the DataReaders
with DataViews so I can explicitly close the Database connection.
Any other ideas (I would model the database via business objects and return
these but I really do not have the time as we need a "quote" quick fix).
Thanks
Mark
- Previous message: Frank Mamone: "Re: How are static variables handled in asp.net"
- Next in thread: Marina: "Re: DataView vs DataReader"
- Reply: Marina: "Re: DataView vs DataReader"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|