Using Public Variables
hi
i want to declare a public connection object which i want to access from all the forms. when application starts i want to open the database using this connection and i do not want to close the connection till i close my application. how can i implement this. if i write this in class then wherever i want to use this object i have to create the class instance and open the connection. in vb.net if i declare a varible in module i can access it from any form. is there any better way to implement this in c#. please give me a solution.
regards
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Bhakeeswaran Thulasingam173 reputationPosted Sep 3, 2006, 8:19 PM EDT
milind khire33 reputationPosted Oct 3, 2006, 5:34 AM EDT
savan gandhi45 reputationPosted Oct 6, 2006, 3:24 AM EDT