|
-
Jul 1st, 2007, 07:11 PM
#1
Thread Starter
Addicted Member
inheriting IDisposable...for using {} blocks.
Greetings,
Say i have the following class, which read has a function to return a dataset full of config info...:
class ReadConfig {
//logic to read config goes here, and config uses a dataset...
}
what i want is to able to use the using {} so that it can dispose. I know this is done like so...
class ReadConfig : IDisposable {
void IDisposable.Dispose() { }
//logic to read config here...
}
ok, so my question is, if im using a using{} block in my code to handle this, will is automatically dispose that dataset that it returns, as its not referenced, or do i manually need to call the dispose() method from within the function to return the dataset, or do i need to add an overloaded method, and dispose it in there??
Cheers, Justin
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|