private void BT_AanmeldenAanmelden_Click(object sender, EventArgs e) { this.Cursor = Cursors.WaitCursor; using (connection = new SqlConnection(connectionstring)) using (SqlDataAdapter adapter = new SqlDataAdapter("Select Count(*) From Users Where Email = '" + TX_AanmeldenGebruikersnaam.Text + "' and Wachtwoord = '" + TX_AanmeldenWachtwoord.Text + "'", connection)) { DataTable dt = new DataTable(); adapter.Fill(dt); if (dt.Rows[0][0].ToString() == "1") { Progres_Login.Visible = true; TimerLogin.Start(); this.Cursor = Cursors.Default; } else { this.Cursor = Cursors.Default; MessageBox.Show("De door u ingevulde gebruikersnaam en wachtwoord zijn incorrect", "##**## | Error", MessageBoxButtons.OK, MessageBoxIcon.Asterisk); } } }
try{ adapter.Fill(dt); } catch (Exception exp) { // do something }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)