how to change sqlconnection string dynamically
change connection database or connect to sql server where i can access all databases avaliable
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.
Ring ZhongPosted Sep 29, 2013, 10:13 PM
Then retrieve it by using ConfigurationManager:
ConfigurationManager.ConnectionStrings["Target"].ConnectionString
EDIT:
You also need to reference the System.Configuration library in order to make it work.
A simple
textBox1.Text = ConfigurationManager.ConnectionStrings["Target"].ConnectionString;
Will show your connection string