title: How to define a connection string to a SQL Server 2008 database?
body: <p>I'm using MS Visual Studio 2010 to create an application with SQL Server 2008 database access, but what I did to create the database was add a new "SQL Server 2008 Database Project", it added it, and shows me everything on my Solution Explorer, but how do I write the connection string to connect to it, because I wrote this one, and it didn't work.</p>
  
  <pre><code>SqlConnection cnTrupp = new SqlConnection("Initial Catalog = Database;Data Source = localhost;Persist Security Info=True;");
  </code></pre>
  
  <p>update:</p>
  
  <p>I used this one:</p>
  
  <pre><code>cnTrupp = new SqlConnection("database=DB_Trupp;server=.\\SQLExpress;Persist Security Info=True;integrated security=SSPI");
  </code></pre>
  
  <p>But when I use the <code>cnTrupp.Open()</code> it tells me that the login failed.</p>