Stoop wrote:
Well - I guess I look like an idiot with the sample code I put in my
original question - it was only to show what I meant by my original question
of "Is there a method or property that one can access that will flag if a
DataAccessAdapter has been disposed?" Apparently, there isn't. In my humble
opinion, I think there should be as I'm sure there are times when one's code
might need to check this condition to avoid run time errors..
Anyway - thanks again for your input and support
I understand the question, at times I also wonder if a given control / class is disposed, but actually, when you ask that question, do realize that the check is actually not allowed: if an object is disposed, it can't be used in any expression whatsoever: the internals are no longer accessible.
So when you NEED the knowledge if an object is disposed or not, it's actually better to rethink the design, as either: you use a global object which shouldn't be disposed (or only once) or you only use local objects and you don't need the flag.
With the adapter, it's best to use local objects only, so never create a global adapter and share that, unless you need to pass it on to methods which have to share the same transaction: in that situation, you still dispose at the spot where the object is created, the starter of the transaction.
Hope this helps a bit