title: How to connect to local SQL Server database?
body: <p>I am creating a web application/website using ASP.net in visual studio 2010.  We have our basic website and I even created a SQL Server database which is in the <code>App_Data</code> folder of my web application folder.  </p>
  
  <p>I created tables and a few procedures, but I do not know how to have my web forms or their controller (C#) classes access the tables. Below is my rough setup to access it. I don't know what to set the string to equal. The database is in <code>webapplication1/App_Data/database.mdf</code>.  </p>
  
  <p>The file I want to access it is <code>webapplication/App_Code/DataConnect.cs</code>. What should the string equal. What do I need to do to test it?</p>
  
  <pre><code>{ 
  SqlConnection _sqlConn = null;
  string _connectionString = ?
   _sqlConn2 = new SqlConnection(_connectionString);
   _sqlConn.Open();
  }
  </code></pre>