Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- string b = Convert.ToString(UserNameComboBox.SelectedItem);
- SqlConnection DataFind = new SqlConnection(@"Data Source=.sqlexpress; Initial Catalog=PAYROLL MANAGEMENT SYSTEM;Integrated security=true;");
- DataFind.Open();
- SqlCommand dmd;
- dmd = new SqlCommand("SELECT COUNT(*) FROM LoginDetail where( (UserName=' " + b + "') AND (Password='" + Password.Text + "' ))", DataFind);
- dmd.ExecuteNonQuery();
- Int32 count = Convert.ToInt32(dmd.ExecuteScalar());
- DataFind.Close();
- SelectedRowNo.Text = count.ToString();
- if (count == 1)
- {
- Form1 s = new Form1();
- s.Show();
- }
- else
- {
- MessageBox.Show("Sorry You are not an authirized user");
- }
- }
- catch { MessageBox.Show("UserName or Password not valid");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement