title: C# and SQL Server 2008 R2: Finding DB Address and connection string
body: <p>I have SQL Server 2008 R2 installed and have the necessary databases created. Now I am trying to connect to the server through C# and failing miserably. I have tried several connection string formats from connectionstrings.com, but I still cannot connect to the database. This is the format I'm assuming I'm to use:</p>
  
  <pre><code>        public static void connect()
          {
          string conString = "Data Source=myServerAddress;Initial Catalog=myDataBase;User Id=myUsername;Password=myPassword"; 
  
          SqlConnection con = new SqlConnection(conString);
          try
          {
              con.Open();
          }
          catch (Exception e)
          {
              Console.WriteLine("Unable to connect to database");
          }
      }
  </code></pre>
  
  <p>But I can't seem to identify the correct address and authentication (using windows authentication). How can I find the address in MSSM, and how would I properly use windows authentication?</p>
  
  <p>Thanks so much.</p>
  
  <p>Note: I am using Visual Studio 2010</p>