Global database connection string in Win

csharp United States
  • 19 years ago

    Is there a way to have one connection string, in this case an OleDbConnection to an Access database, that can be accessed globally from more than one class?  Is it possible to have one connection string that covers an entire application?  Thanks for any help.


    Kyle

  • 19 years ago

    You could declare it as a constant in the root namespace (ie MyApp), and then access it using MyApp.GlobalConnectionString or something.....

Post a reply

Enter your message below

Sign in or Join us (it's free).

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Engineers are all basically high-functioning autistics who have no idea how normal people do stuff.” - Cory Doctorow