Global classes

  • Thread starter Thread starter Rodrigo
  • Start date Start date
R

Rodrigo

Dears,

I have an application with around 10 forms. I need to access the SQL CE in
most of them.

I've created a class that has the connection object declaration. How can I
share the same connection to all the forms?

When I try to call NameSpace.class.connection the compiler send me a error
message.

Thanks for any help.

Rodrigo.
 
Hi, Rodrigo

You can declare connection as public static or expose it as public property.
Have a look at definition of static and public in MSDN. Samples will help
you to find the best way for you

HTH
Alex
 
Back
Top