Has anyone tried this?
My general dilemma is having to open and maintain multiple connections across multiple forms.
I have an MDI application and I would prefer to store the connection in the parent form and just have the child forms use that connection if it needs it. This normally wouldn't be a problem except that the application can have many different data source types (a SQL Server or a Access Database). So simply using a delegate won't work because I can't cast the connection to the correct connection type until run time.
I have a feeling what I will have to do is use a delegate with the type of
Object , and just use a
if (Connection is _______) type of thing and cast it inside of the if statement and then call whatever functions the form needs to use the connection object.
Any other ideas or solutions that someone has used that they care to share?