private void btRegistreer_Click(object sender, EventArgs e) { try { SQLService sqlService = new SQLService(); sqlService.Insert("INSERT INTO gebruiker (username,password,user_voornaam,user_achternaam,email,admin_level) VALUES ('Josh', 'Josh','Josh','Josh','Josh',1) "); } catch (Exception obj) { MessageBox.Show(obj.Message); } }
private void btLogin_Click(object sender, EventArgs e) { try { SQLService sqlService = new SQLService(); bool bestaat = sqlService.Bestaat("SELECT * FROM gebruiker WHERE username = '******' AND password = '******' "); if (bestaat == false) { MessageBox.Show("Bestaat niet"); } else { MessageBox.Show("Bestaat"); } } catch (Exception) { throw; } }
private void bt_Add_Click(object sender, EventArgs e) { SQLService sqlService = new SQLService(); sqlService.Insert("INSERT INTO Categorie (Catergorie_naam) VALUES('" + textBox1.Text +"')"); }