Its advisable to take the parameters when parameter no. are more than 2. This type of queries always confuse you and create problems of single quotes and many other
change your query format to this:
private void button1_Click(object sender, EventArgs e)
{
SqlConnection connect = new SqlConnection(ConnString);
connect.Open();
string q = "Update people set name=@name where id=@id";
SqlCommand comm = new SqlCommand(q, connect);
comm.Parameters.AddWithValue("name", txtname.Text);
comm.Parameters.AddWithValue("id", int.Parse(txtid.Text.ToString()));
comm.ExecuteNonQuery();
connect.Close();
}