Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SqlConnection cnn = null;
- SqlCommand cmd = null;
- SqlDataAdapter sda = null;
- DataTable Dt = new DataTable();
- cnn = new SqlConnection("Server=dbadmin01.database.windows.net;Database=dbadmin;User=info;Password=notGivingThis");
- cmd = new SqlCommand("SELECT username FROM users WHERE username =@TextboxValue", cnn);
- cnn.Open();
- cmd.CommandType = CommandType.Text;
- cmd.Parameters.Add("@TextboxValue", SqlDbType.VarChar).Value = txtUser.Text;
- sda = new SqlDataAdapter(cmd);
- sda.Fill(Dt);
- if (Dt.Rows.Count > 0)
- {
- //Works - do nothing for now
- }
- else
- {
- MessageBox.Show("Username is incorrect!", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
- }
- cnn = new SqlConnection("Server=dbadmin01.database.windows.net;Database=dbadmin;User=info;Password=notGivingThis");
- cmd = new SqlCommand("SELECT passcode FROM users WHERE passcode =@PasswordValue", cnn);
- cnn.Open();
- cmd.CommandType = CommandType.Text;
- cmd.Parameters.Add("@PasswordValue", SqlDbType.VarChar).Value = pwdPassword.Password;
- sda = new SqlDataAdapter(cmd);
- sda.Fill(Dt);
- if (Dt.Rows.Count > 0)
- {
- //Works - Do nothing for now
- }
- else
- {
- MessageBox.Show("Password is incorrect!", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement