OleDbConnection con = new OleDbConnection();
con.ConnectionString = connection.connstring;
con.Open();
OleDbCommand cmd = new OleDbCommand();
cmd.CommandText="update info set fname=@a,lname=@b,cname=@c,add=@d,contactno=@e,city=@f,pincode=@g where ID='" + textBox2.Text + "'";
cmd.Connection = con;
cmd.Parameters.AddWithValue("@a", textBox1.Text);
cmd.Parameters.AddWithValue("@b", textBox3.Text);
cmd.Parameters.AddWithValue("@c", textBox4.Text);
cmd.Parameters.AddWithValue("@d", richTextBox1.Text);
cmd.Parameters.AddWithValue("@e", textBox5.Text);
cmd.Parameters.AddWithValue("@f", textBox6.Text);
cmd.Parameters.AddWithValue("@g", textBox7.Text);
int i = cmd.ExecuteNonQuery();
if (i > 0)
{
MessageBox.Show("Data is updated");
}