title: Getting initial catalog from the web.config file
body: <p>I have a connection string in the web.config file. I have to get the database name from it.
  Let say my connection sting is </p>
  
  <pre><code>&lt;add name="LocalSqlServer" connectionString="Data Source=XYZ;Initial Catalog=MyDataBase;Integrated Security=true" providerName="System.Data.SqlClient"/&gt;
  </code></pre>
  
  <p>I want to get the database name [i.e. Initial Catalog] from the connection string.</p>
  
  <p>How can I get it?</p>