
Originariamente inviata da
oregon
Ovvio che hai errori, non hai la minima idea della sintassi
codice:
private void button2_Click(object sender, EventArgs e)
{
string connection = "server=localhost;user id=root;password=LJ4L6BFXMYVX;database=evan";
string query = "UPDATE presenti SET presente='" + this.textBox6.Text + "' WHERE idpresenti='" + this.textBox1.Text + "'";
MySqlConnection conn = new MySqlConnection(connection);
MySqlCommand cmd = new MySqlCommand(query, conn);
MySqlDataReader dr;
conn.Open();
dr = cmd.ExecuteReader();
string query2 = "UPDATE sods SET presente='" + this.textBox6.Text + "' WHERE idsods='" + this.textBox1.Text + "'";
MySqlCommand cmd2 = new MySqlCommand(query2, conn);
MySqlDataReader dr2;
dr2 = cmd2.ExecuteReader();
MessageBox.Show("dati aggiornati con successo!");
conn.Close();
}