Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hi all,

 

Ok, I'm having trouble figuring out how to create an application wide connection to my database. I tried creating a module, and having it be the first object loaded when the program starts. The problem that I'm having is that I've declared the connection in the module, but when I attempt to use it on a form, it says that the connection hasn't been declared. What can I do?

 

Thanks in advance,

 

Chris

if(computer.speed == "slow")
    {  
       hamster.feed();  
    }
if(computer.speed == "really slow")
    {  
        hamster.kill();
        BuyNewHamster();
    }

  • Moderators
Posted

Instead of a module create a class with a readonly property that returns the string.

 

Then at the top of any other class that may need this connection string instantiate the con class and retrieve the property as needed.

Visit...Bassic Software

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...