title: How can I troubleshoot: A connection was successfully established with the server, but then an error occurred during the login process
body: <p>I am trying to create the application in <a href="https://docs.microsoft.com/en-us/windows/uwp/data-access/sql-server-databases" rel="noreferrer">this demo</a> but with my own database. All I am trying to do for now, is show one data table. I am using Visual studio 2017 pro, and am connecting to an older SQL Server version 10.50.1600. I am able to connect to the database with windows authentication via SSMS, but when I try to connect with my application I get the following error message. </p>
  
  <blockquote>
    <p>A connection was successfully established with the server, but then an
    error occurred during the login process. (provider: TCP Provider,
    error: 0 - The operation completed successfully)</p>
  </blockquote>
  
  <ul>
  <li>I have the following capabilities enabled: Enterprise Authentication, Internet (Client &amp; Server), Internet(Client), Private Networks(Client &amp; Server)</li>
  <li>I changed the server to another, more current DB server, and it worked... so I am thinking it may be a setting on the database server that I have to change. I have no idea how to know what to change though.</li>
  <li>I am running under UWP build 16299, and have followed the steps in the demo very closely. I've re-created this app a few times to ensure that I am not missing any steps. The rest of the app works fine. </li>
  </ul>
  
  <p>I have spent hours looking around the internet for a solution for this error. There seem to be many reasons that this error can come up but I have yet to see a solution that worked for me. </p>
  
  <p><strong>I'm wondering if people can give me tips on where I can look to see why this is happening. I can't see anything helpful in the Autos list, but I'll attach it in case there's something that jumps out at others.</strong> </p>
  
  <p>My connection string and class are below. As I mentioned, it does connect, but then complains about something at login: </p>
  
  <p><strong>Screenshot of error message</strong></p>
  
  <p><a href="https://i.stack.imgur.com/hLmbT.png" rel="noreferrer"><img src="https://i.stack.imgur.com/hLmbT.png" alt="enter image description here"></a>
  <strong>Connection String</strong>  </p>
  
  <pre><code>public string ConnectionString { get; set; } = "Server=servername; Trusted_Connection=Yes; Integrated Security=True;";
  </code></pre>
  
  <p><strong>Connection Class</strong></p>
  
  <pre><code>public ObservableCollection&lt;MyAssignments&gt; GetMyAssignments(string connectionString)
          {
              string GetMyAssignmentsSQLFile = File.ReadAllText(@".\SQL\MyOpenAssignments.sql");
  
              var myAssignments = new ObservableCollection&lt;MyAssignments&gt;();
              try
              {
                  using (SqlConnection conn = new SqlConnection(connectionString))
                  {
  
                      conn.Open();
                      if (conn.State == System.Data.ConnectionState.Open)
                      {
                          using (SqlCommand cmd = conn.CreateCommand())
                          {
                              cmd.CommandText = GetMyAssignmentsSQLFile;
                              using (SqlDataReader reader = cmd.ExecuteReader())
                              {
                                  while (reader.Read())
                                  {
                                      var myAssignment = new MyAssignments();
  
                                      myAssignment.CallID = reader.GetString(0);
                                      myAssignment.RecvdDate = reader.GetString(1);
                                      myAssignment.CallStatus = reader.GetString(2);
                                      myAssignment.Priority = reader.GetString(3);
                                      myAssignment.Classification = reader.GetString(4);
                                      myAssignment.CallDesc = reader.GetString(5);
                                      myAssignment.CloseDesc = reader.GetString(6);
                                      myAssignments.Add(myAssignment);
                                  }
                              }
                          }
                      }
                  }
                  return myAssignments;
              }
              catch (Exception eSql)
              {
                  Debug.WriteLine("SQL-Exception: " + eSql.Message);
              }
              return null;
          }
      }
  </code></pre>