Check this example. Now please take its reference and correct your code.
SqlConnection conn = new SqlConnection(str);
SqlCommand cmd = new SqlCommand("INSERT INTO Customers VALUES(@Id,@Name,@Country)", conn);
conn.Open();
cmd.Parameters.AddWithValue("@Id", txtCustomerID.Text);
cmd.Parameters.AddWithValue("@Name", txtName.Text);
cmd.Parameters.AddWithValue("@Country", txtCountry.Text);
cmd.ExecuteNonQuery();
conn.Close();
SqlCommand cmd1 = new SqlCommand("DELETE FROM CustomerDetails WHERE Name = @Name", conn);
conn.Open();
cmd1.Parameters.AddWithValue("@Name", txtName.Text);
cmd1.ExecuteNonQuery();
conn.Close();