title: How to Navigate in UWP to another xaml page by clicking a button?
body: <p>I am trying to validate user data and when it is correct navigate to another xaml page. what I have, it and show the MainPage which is the Login window but when I enter data and click the button it closes the window, it's not checking the user input.</p>
  <p>Here is what I have:</p>
  <pre><code>        private void Login_Click(object sender, RoutedEventArgs e)
         {
              Connection.Open();
              // sda = new MySqlDataAdapter(&quot;select count(*) from customers where Name = '&quot; + loginName.Text + &quot;' and Password = &quot; + password.Password +&quot;&quot;, Connection);
              string query = &quot;SELECT * FROM customers WHERE Name = '&quot; + loginName.Text + &quot;' and Password = '&quot; + password.Password + &quot;'&quot;;
              MySqlCommand cmd = new MySqlCommand();
              cmd.CommandText = query;
              MySqlDataAdapter sda = new MySqlDataAdapter(query, Connection);
              DataTable dt = new DataTable();
              sda.Fill(dt);
             
  
  
              if (dt.Rows.Count == 1)
              {
                  this.Frame.Navigate(typeof(BlankPage1));
  
                  /* BlankPage1 main = new BlankPage1();
                  main.Show();
                  this.Hide();
                  Connection.Close(); */
              }
              else
              {
                  message.Text = &quot;Wrong Name or Password! Please, try again!&quot;;
                  /* var messageDialog = new MessageDialog(&quot;Wrong Name or Password&quot;);
                  await messageDialog.ShowAsync(); */
              } 
              Connection.Close(); 
         }
  </code></pre>
  <p>The commented statements are different things that I was trying.</p>
  <p>Please, I need help to find out the problem, I will really appreciate any help.</p>
  <p>Thank you in advance!</p>