title: SQLConnection connection error "Login failed for user server/guest"
body: <p>I keep receiving a connection error.  I know that the information is right, as I tried them out with SSMS now several times in the last few minutes, so the problem is in the C# connection string.  According to various Google searches, the syntax is right, just it does not work.</p>
  
  <pre><code>try
  {
      // Get the connection information.
      GetSQLConnectInfo(ref sConnect);
  
      // Formulate the connection string.
      String strConnect = String.Format("Server=myserver;Database=mydb;User Id=myusername;Password=mypassword;Trusted_Connection=yes;connection timeout=30");
  
      // DATABASE: Create the connection.
      SqlConnection oConnection = new SqlConnection(strConnect);
      oConnection.Open();
      if (ConnectionState.Open != oConnection.State)
          return false;
  
      return true;
  }
  
  catch
  {
  }
  </code></pre>
  
  <p>Error comes back with: Login failed for user 'myserver\Guest'.
  Error Code: -2146232060
  Error Number: 18456</p>
  
  <p>It would seem that judging by the error message, the Open method does not recognize the user name, as Open tries to use a guest account, which obviusly will not work.</p>
  
  <p>Am I missing something?  I am using SQL Server authentication.</p>