sujeeth

sujeeth

  • NA
  • 5
  • 0

using Public Variables

Sep 1 2006 12:07 AM
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

Answers (3)