|
-
Jan 27th, 2003, 06:59 AM
#1
Thread Starter
Member
Global Db connection
I want to add a global Database connection object to my project. I have created the class and all is working. I have done the following in a form
namespace Forms
{
public class frmLogin : System.Windows.Forms.Form
{
//'DataAccess object
public clsDataAccess gDB = new clsDataAccess();
....
BUT
This teh objects is only accessible from that form. I have to do this on each form that I open in order to access the db.
Is there a a way to create a global object of type clsDataAccess so that I can access the same object from any form or class.
Alternatively, if I just create one object, how can I pass that object to another form??
Any help appreciated.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|