title: Trying to load & verify data WPF ( xaml ) connected to SQL server
body: <p>I'm trying to load &amp; verify to create a login system for my App. But it seems that is not loading the user and password textbox.</p>
  
  <p>Here's my C# code</p>
  
  <pre><code>private void btnAceptarLogin_Click(object sender, RoutedEventArgs e)
  {
      TextBox usuarioLogin = usuariosTextBox;
      TextBox passwordLogin = passwordTextBox;
  
      SqlConnection conexion  = new SqlConnection();
      conexion.ConnectionString = @"Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=dolphinsplendidus_Plataforma1; Data Source=. \SQLEXPRESS";
      conexion.Open();
  
      SqlCommand comando = new SqlCommand();
      comando.CommandText = "SELECT [Usuario], [Password] FROM [DatosUsuarios]";
      comando.Connection = conexion;
  
      SqlDataReader lector = comando.ExecuteReader();
  
      while (lector.Read())
      {
        if (usuarioLogin == lector["Usuario"] &amp;&amp; passwordLogin == lector["Password"])
        {
            VentanaPrueba venPrueba = new VentanaPrueba();
            venPrueba.ShowDialog();
        }
        else
        {
            MessageBox.Show("Introduzca un usuario y contraseña valido y/o contactese con el administrador");
            MessageBox.Show("Usuario: " + lector["Usuario"] + ", Password: " + lector["Password"]);
        }
      }
  }
  </code></pre>
  
  <p>There's a method to see if TextBox's are Reading? I'm 99% sure the problem comes from those "TextBox"</p>
  
  <p>In the .xaml is declared like these</p>
  
  <p>Password TextBox = <code>&lt;TextBox x:Name="passwordTextBox /&gt;</code><br>
  User TextBox = <code>&lt;TextBox x:Name="usuariosTextBox /&gt;</code></p>