Hi Phil,
If you added an appSetting called DBConnection
string value = ConfigurationManager.AppSettings["DBConnection"];
If you added a connectionString called DBConnection
string value =
ConfigurationManager.ConnectionStrings["DBConnection"].ConnectionString;
If you added a Setting called DBConnection
string value = Properties.Settings.Default.DBConnection;
or
string value =
ConfigurationManager.ConnectionStrings["MyNameSpace.Properties.Settings.DBConnection"].ConnectionString
--
Happy Coding!
Morten Wennevik [C# MVP]
"Phil Johnson" wrote:
Hi, I have right clicked my project in VS2008 and added a DB Connection
application setting.
How do I access these settings from my code?
I know this must be pretty simple, but I cannot see how to do it.
--
Regards,
Phillip Johnson (MCSD For .NET)
PJ Software Development
www.pjsoftwaredevelopment.com