```
private void button2_Click(object sender, EventArgs e) 
{ 
    SqlConnection  con =  new  SqlConnection (strcon);

    string query = "update BrandSet set BrandName='" 
                   +  this.textBox1.Text  +  "', Ml = '" 
                   + this.textBox2.Text + "', Price='" 
                   +  this.textBox1.Text 
                   +  "' where Id = ";

    SqlCommand command = new SqlCommand(query, con);

    SqlDataReader adapt;

    try
    {
        con.Open();
        adapt = command.ExecuteReader();
        con.Close();

        MessageBox.Show("Brand Updated Successfully");
    }
    catch (Exception ex)
    {
        MessageBox.Show(ex.Message);
    }

```

I want to know how to assign `Id` to update and delete record.