Connection String in app.xaml file in WPF application
Can i write connection string in app.xaml file in wpf application if yes then how ? how to access in class file while coding ? how to change or access after creating setup (exe) file ?
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.
Raja TPosted Jul 31, 2015, 10:50 PM
and In your CS Code use it like this
SqlConnection con= new SqlConnection(ConfigurationManager.ConnectionStrings["Connection"].ToString());
Con.Open();
then use that opned connection according to your need.
More details check out bellow URLs
http://www.experts-exchange.com/Programming/Microsoft_Development/Q_25025973.html
http://www.codeproject.com/Articles/118532/Saving-Connection-Strings-to-app-config