Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- enter code here
- {
- OleDbConnection con = new OleDbConnection(@"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=.MSAccessTestDB.accdb");
- private void button1_Click(object sender, EventArgs e)
- {
- con.Open();
- OleDbDataAdapter sda = new OleDbDataAdapter("SELECT * FROM LOGIN where username='" + textBox1.Text + "' and password='" + textBox2.Text + "'", con);
- DataTable dt = new DataTable();
- sda.Fill(dt);
- if (dt.Rows.Count == 1)
- {
- this.Hide();
- Form2 ss = new Form2();
- ss.Show();
- }
- else
- {
- MessageBox.Show("Invalid username/Password");
- }
- con.Close();
- }
- }
Add Comment
Please, Sign In to add comment