private void submit_Click(object sender, EventArgs e) { try { conn = new OleDbConnection(connectionstring); OleDbCommand cmd = new OleDbCommand(); cmd.CommandType = CommandType.Text; cmd.CommandText = "insert into login ([username],[password]) values (?,?)"; cmd.Parameters.AddWithValue("@username", textBox1.Text); cmd.Parameters.AddWithValue("@password", textBox2.Text); cmd.Connection = conn; conn.Open(); cmd.ExecuteNonQuery(); } catch (Exception ex) { MessageBox.Show("Παρουσιάστηκε κάποιο σφάλμα. Δοκιμάστε ξανά !"); } finally { conn.Close(); } LogInForm first = new LogInForm(); first.Show(this); this.Hide(); }
private void button3_Click(object sender, EventArgs e) { LogInForm log = new LogInForm(); log.Show(); this.Hide(); visited.Clear(); delete_history(); }