ado.net GC IDisposable implementation
- From: Matthew Shelton <crash700@xxxxxxxxx>
- Date: Sun, 04 Nov 2007 13:32:21 -0500
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
I apologize in advance for the dead horse im beating ;) I haven't found
much that specifically relates to this question.
Anyways, I have a simple CRUD/USER app written in C# for a customer
contact database. On the whole, everything is in order, however:
I wrote a class (eventually having derivative classes for all the data
sources) that contains all the classes I need to do CRUD operations, for
easy access.
I'm wondering if the implementation of IDisposable for *my* class is
necessary (specifically for datasets, datatables, and connections).
I have taken steps to ensure connections are opened and closed
appropriately, and that datasets are cleared when their life is over (at
the end of methods)
I wanted to use a "using ( Table Cust = new Table()) {} statement in my
buttonClick events, to ensure any resources are released (like a huge
dataset and its DB connection), but I need to implement IDisposable for
this to work
is it as simple as calling the .Dispose() methods of the class members
with .Dispose() methods already implemented?
maybe it would be better to just use "using (DataSet DS = new
Dataset("customer")) to ensure the resource is released? --and avoid
implementing a Dispose() method alltogether
I've attached a class diagram of the SQL and Table:SQL class.
Thanks in advance for the advice.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFHLhA19v5kFOkJa9gRAifyAKC67Mts1rKZ4aiHCLXKF/D9aSELZQCggOh3
RvRsVxlprzkT59wyvYU+U4A=
=oAyN
-----END PGP SIGNATURE-----
begin:vcard
fn:Matthew Shelton
n:Shelton;Matthew
adr;dom:;;;Philadelphia;PA
email;internet:crash700@xxxxxxxxx
x-mozilla-html:FALSE
version:2.1
end:vcard
- Follow-Ups:
- Re: ado.net GC IDisposable implementation
- From: Samuel R . Neff
- Re: ado.net GC IDisposable implementation
- From: Peter Morris
- Re: ado.net GC IDisposable implementation
- Prev by Date: Not a valid MSI?
- Next by Date: Re: Not a valid MSI?
- Previous by thread: Not a valid MSI?
- Next by thread: Re: ado.net GC IDisposable implementation
- Index(es):
