passing data from config file
Posted: Wed Sep 14, 2011 10:01 am
Hi,
We want to pass some value from config file
I added below code to "C:\Documents and Settings\<User>\Application Data\RanorexConfig3.xml"
<appSettings>
<add key="DBConnectionString" value="Password=xxxx;Persist Security Info=True;User
ID=xxx;Initial Catalog=testing;Data Source=1.1.1.1">
</appSettings>
I am trying to retrive using below code
ConfigurationSettings.AppSettings["DBConnectionString"].ToString();
But I am getting object null reference
Let me know where I have gone wrong
Thanks,
Abhigna
We want to pass some value from config file
I added below code to "C:\Documents and Settings\<User>\Application Data\RanorexConfig3.xml"
<appSettings>
<add key="DBConnectionString" value="Password=xxxx;Persist Security Info=True;User
ID=xxx;Initial Catalog=testing;Data Source=1.1.1.1">
</appSettings>
I am trying to retrive using below code
ConfigurationSettings.AppSettings["DBConnectionString"].ToString();
But I am getting object null reference
Let me know where I have gone wrong
Thanks,
Abhigna