How can I use the connectionString defined in APP.Config in datasource wizard? I can do it in a web application easily but I can't do it in non web application program.
2 Answers
You need to use the bellow syntax to retrive the connection string from app.config
string conStr = ConfigurationManager.ConnectionStrings["NorthwindConnection"].ConnectionString;
Then use the bellow syntax.Oh!first of all you need to add using System.Configuration; name space
Connection = new SqlConnection(conStr);
1 Comment
Raymond Morphy
Thanks for your answer, but how can I use it in DataSource configuration wizard, in "which data connection should you application use to connecto to dabase" part, my mean is in design not in run time