Update mysql tables in C#

Oct 29 2009 8:39 AM
Hi, yall. Am trying to update mysql table called exemptions with texts in textboxes (txt......)but when i go back to the table, no changes is made in the table. below is the code.
[code]
private void btnUpdate_Click(object sender, EventArgs e)
        {
                MySqlConnection mycon = new MySqlConnection("datasource=localhost;username=root;database=church");

                MySqlCommand updatecom = new MySqlCommand("Update exemptions  set exemptions = '" + txtexempt.Text + "',exempt1='"
                    + txtexempt1.Text + "',exempt2='" + txtexempt.Text + "' where ID ='" + txtmeid.Text + "'", mycon);

                mycon.Open();

                updatecom.ExecuteNonQuery();

                mycon.Close();

                MessageBox.Show("Member Id " + txtmeSname.Text + " has sucessfully been updated");

                this.reset();
         }

[/code]
Please someone tell me what to do

Answers (2)