Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void btnLogIn_Click(object sender, EventArgs e)
- {
- try
- {
- OleDbCommand command = new OleDbCommand("select * from Account where UserName = '" + txtbxUserName.Text + "' and Password = '" + txtbxPassword.Text + "' ");
- OleDbDataReader theReader;
- conn.Open();
- theReader = command.ExecuteReader();
- int count = 0;
- string uType = string.Empty;
- while (theReader.Read())
- {
- count = count + 1;
- uType = theReader["UserType"].ToString();
- }
- if (count == 1)
- {
- MessageBox.Show("Username and Password . . . is Correct", "Confirmation Message", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
- this.Hide();
- if (uType == "Admin")
- {
- B_E backend = new B_E();
- this.Hide();
- backend.ShowDialog();
- }
- else
- {
- this.Close();
- }
- }
- }
- catch(Exception ex)
- {
- MessageBox.Show(ex.Message);
- }
Add Comment
Please, Sign In to add comment