I´m new in the c# business.
I need to store in a new text file, some values from a web.config file that has this tag
and i need to store at the value (data source=Server\Instace).
Can anyone help me please?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Niradhip ChakrabortyPosted May 14, 2009, 11:59 AM
No,you need to pass the key name to retrieve the value. Basically it’s a key value pair. Without the key you can’t fetch the value from web.config.
ricardo rosaPosted May 14, 2009, 11:42 AM
And if i dont know exactly the name? Like all the names that have conn on it?
Niradhip ChakrabortyPosted May 14, 2009, 11:30 AM
you can access it like this.
string strValue = ConfigurationManager.AppSettings["SqlConnectionString1"];