Yes, The second Form only needs the connection, and does not need to know anything from form1. Therefore, the static member implementation worked well. I am connecting to Access but I hope that migrating to SQLServer in the future will not be too difficult if I have >1 connection. I don't...
Ok! The static member of a class works! Here is what I used. I created this class in the namespace of my main Form after all declarations etc... of the main form class. I tried to put it before the class fclForm1{ class stuff ...} but this caused some rescource errors.
public class...
I would like to share the same database connection between two Forms. I would like to use the same connection to associate OleCommands that are executed in each form/class.
My main form creates my second form (a modal dialog) that I want to use to insert user input to the database.
How do I...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.