I’m going to demonstrate how to get connection string from App.config in C#.Net.

<?xmlversion="1.0"encoding="utf-8" ?>
Form1.cs where we are going to use connection string of App.config
//namespace for sqlclient
using System.Data.SqlClient;
//to use connectionstring we have to use System.Configuration namespace
using System.Configuration; 
//fetching connectionstring from App.config
string strConnection= ConfigurationManager.ConnectionStrings["con1"].ConnectionString;
//creating newsqlconnection
 con= new SqlConnection(strConnection);
//opening connection


  1. Utilize the Data Source Wizard to setup a wrote DataSet as DataSource for the report. do my homework This would enable you to utilize the Reporting Designer and all treats that accompany it. At that point supersede the ConnectionString gave by the DataSet the one indicated in your config document

Leave Comment