title: SQL connecting with C# and visual studio
body: <p>I've been trying to learn c#, I tried this site: <a href="http://www.codeproject.com/Articles/4416/Beginners-guide-to-accessing-SQL-Server-through-C" rel="nofollow">http://www.codeproject.com/Articles/4416/Beginners-guide-to-accessing-SQL-Server-through-C</a>, and I'm still confused. </p>
  
  <p>I'm trying to figure out what the basic code is to connect to a database with C#. I haven't created the database yet. I'm just looking for some basic code to make a connection... maybe some code to connect to an already existing database.</p>
  
  <p>The general format of the code is this:</p>
  
  <pre><code>SqlConnection myConnection = new SqlConnection("user id=username;" + 
                                         "password=password;server=serverurl;" + 
                                         "Trusted_Connection=yes;" + 
                                         "database=database; " + 
                                         "connection timeout=30");
  </code></pre>
  
  <p>Is that right? Does anyone have a good primer for SQL and C#? If this is too advanced, what's a good resource to begin learning?</p>