user3823980
user3823980

Reputation: 13

Where to define connection string as global in C# windows app(Like WebConfig in Web App)?

As my question I want to know where can i define a global connection string In Windows Forms Applications in C#? Just like Web-config in Web Applications. AND how to use/access that connection in my code behinds? please respect my apology for this simple question.I'm new to windows form apps Thank you very much

Upvotes: 0

Views: 1762

Answers (2)

Shell
Shell

Reputation: 6849

You can use User's Setting option from the Project Properties. you can create properties here to store the connection info. and you can update it by creating a separate configuration window.

http://msdn.microsoft.com/en-us/library/aa730869(v=vs.80).aspx

there is complete tutorial on codeproject how to use this feature in your application and provide connection information at runtime.

Upvotes: 0

Zohaib Aslam
Zohaib Aslam

Reputation: 595

you will place your connection string inside app.config file.

How to get connection string from app.config

Upvotes: 1

Related Questions