Reputation: 13
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
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
Reputation: 595
you will place your connection string inside app.config
file.
How to get connection string from app.config
Upvotes: 1