Sharing objects across forms and other objects

  • Thread starter Thread starter Evan
  • Start date Start date
E

Evan

Hi,

What is the best method to share objects (such as a SqlConnection)
across many forms. I am currently passing the SqlConnection in to
other forms from the main form through the other forms' constructor.
This is becoming cumbersome when dealing with dozens of forms. What
are the alternatives?

Thanks in advance,
Evan
 
Hi evan,

You can create a class with static members for these escenario, you could
also use a singleton for this.

Cheers,
 
Back
Top