Guest User

Untitled

a guest
Jan 5th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. private void button1_Click(object sender, EventArgs e)
  2. {
  3. SqlConnection sqlcon = new SqlConnection(@"Data Source=(LocalDB)MSSQLLocalDB;AttachDbFilename=E:eAlati - 1366x768FastFoodDemoDBlogindb.mdf;Integrated Security=True;Connect Timeout=30");
  4. string query = "Select * from Table Where username = '" + txtUsername.Text.Trim() + "'and password = '" + txtPassword.Text.Trim() + "'";
  5. SqlDataAdapter sda = new SqlDataAdapter(query, sqlcon);
  6. DataTable dtbl = new DataTable();
  7. sda.Fill(dtbl);
  8. if(dtbl.Rows.Count == 1)
  9. {
  10. ucitavanje objUcitavanje = new ucitavanje();
  11. this.Hide();
  12. objUcitavanje.Show();
  13. }
  14. else
  15. {
  16. MessageBox.Show("Vaše korisničko ime ili lozinka nisu točni! Pokušajte ponovno");
  17. }
  18. }
Add Comment
Please, Sign In to add comment