title: Receive/Load user data after login C# WPF
body: <p>After successful login to application i want to get other data from sql of that user like: name, surname, birthdate  etc. and put it into dashboard.sellerinfo.Text;</p>
  
  <pre><code> private void button_Click(object sender, RoutedEventArgs e)
      {
          DBconnection con1 = new DBconnection();
  
          try
          {
              con1.connection();
              String query = "SELECT * FROM Seller WHERE Login=@Login and Password=@Password";
              SqlCommand Sqlcmd = new SqlCommand(query, con1.con);
              Sqlcmd.CommandType = System.Data.CommandType.Text;
              Sqlcmd.Parameters.AddWithValue("@Login", login.Text);
              Sqlcmd.Parameters.AddWithValue("@Password", password.Password);
              int count = Convert.ToInt32(Sqlcmd.ExecuteScalar());          
  
              if(count==1)
              {
  
                  MainWindow dashboard = new MainWindow();
                  dashboard.Show();
                  this.Hide();
              }
  
              else
              {
                  MessageBox.Show("Username or password is incorrect.");
                  password.Clear();
                  login.Clear();
              }
          }
  
          catch(Exception ex)
          {
              MessageBox.Show(ex.Message);
          }
  
          finally
          {
              con1.close();
          }
      }
  </code></pre>
  
  <p>I tried a lot with reader but something went wrong. Do you have any advice? Thanks</p>