From: Mike on 27 Apr 2010 17:00 Hi! I can not seem to figure out how to get the value of the defaultDatabase <dataConfiguration defaultDatabase="mydb"/> from the app config file. This does not work because the entry is not in the <appSettings>: ConfigurationManager.AppSettings["defaultDatabase"] What are my options? It seems to be so trivial yet.... Many thanks in advance,
From: Tom Shelton on 27 Apr 2010 17:05 On 2010-04-27, Mike <Mike(a)discussions.microsoft.com> wrote: > Hi! I can not seem to figure out how to get the value of the defaultDatabase ><dataConfiguration defaultDatabase="mydb"/> > from the app config file. > > This does not work because the entry is not in the <appSettings>: > > ConfigurationManager.AppSettings["defaultDatabase"] > > What are my options? It seems to be so trivial yet.... > > Many thanks in advance, You can add it to the connectionStrings section... string connectionString = ConfigurationManager.ConnectionStrings["defaultDatabase"].ConnectionString; -- Tom Shelton
|
Pages: 1 Prev: How to read messages from MSMQ Next: winforms project 'ListItem' not Recognized |