title: Get Connection String from Web.config in asp.net
body: <p>I want to know the ways to get connection string from web.config file in asp.net.</p>
  
  <p>I just only know the below way .</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  using System.Configuration;
  
      namespace Sherserve.DataAccessLayer
      {
          public class DBGateway
          {
              public static string conString;
  
              public DBGateway()
              {
                  conString = ConfigurationManager.ConnectionStrings["test"].ToString();
              }
          }
      }
  </code></pre>