M
Mark Olbert
I have an application that creates MDI child windows to edit different datatables in the same
dataset.
At one point in the application cycle, users have the opportunity to log off the database server (so
they can reconnect to a different one). As part of that log off, I clear the dataset.
Unfortunately, if an MDI child form has been opened and then closed, the datatable for that form
hangs on the clear (i.e., aDataTable.Clear() stalls forever). This problem does not occur if that
table's form has not been opened and closed.
This seems to be a problem where the MDI child form, while "closed", is still maintaining a
reference to the datatable (probably through databinding?).
How do I get rid of this reference so that datatable can be cleared? I've tried setting the
MDIParent property of the MDIChild form to null in an event handler for the MDIParent form that
watches for MDIChild Close events, followed by a call to MDIChild.Dispose(). Unfortunately, that
does't solve the problem.
Any leads or workarounds would be greatly appreciated.
- Mark
p.s. BTW, this is looks to be the second "silent failure" of the NET Framework I've come across in
the past week (the first had to do with the way the Framework's handling of DBNull values for bound
DateTimePicker controls breaks the BindingContext.Position code, with no outward sign of a problem).
I'm beginning to think the NET Framework design team didn't take enough advantage of exception
handling in developing the Framework.
dataset.
At one point in the application cycle, users have the opportunity to log off the database server (so
they can reconnect to a different one). As part of that log off, I clear the dataset.
Unfortunately, if an MDI child form has been opened and then closed, the datatable for that form
hangs on the clear (i.e., aDataTable.Clear() stalls forever). This problem does not occur if that
table's form has not been opened and closed.
This seems to be a problem where the MDI child form, while "closed", is still maintaining a
reference to the datatable (probably through databinding?).
How do I get rid of this reference so that datatable can be cleared? I've tried setting the
MDIParent property of the MDIChild form to null in an event handler for the MDIParent form that
watches for MDIChild Close events, followed by a call to MDIChild.Dispose(). Unfortunately, that
does't solve the problem.
Any leads or workarounds would be greatly appreciated.
- Mark
p.s. BTW, this is looks to be the second "silent failure" of the NET Framework I've come across in
the past week (the first had to do with the way the Framework's handling of DBNull values for bound
DateTimePicker controls breaks the BindingContext.Position code, with no outward sign of a problem).
I'm beginning to think the NET Framework design team didn't take enough advantage of exception
handling in developing the Framework.