Loading color scheme

How to read connection string from App.config

If you are writing console application in C# and need to use the database connection, probably you would like to store the connection string in the App.config file. This is a common practice for C#.NET applications. But how to read the connection string from the file? See the answer below: 

 

ConnectionString = System.Configuration.ConfigurationManager.ConnectionStrings["ConnectionStringName"].ConnectionString;
Get all interesting articles to your inbox
Please wait