That is because you are assigning
comboBox1.SelectedItem
to id in query. That is actually a object, but you should be providing the value.
Use
SelectedValue Property[
^] to get the value.
SqlCommand command = new SqlCommand("select name from table1 where id='" + comboBox1.SelectedValue +"'", conn);
But you should always use
Parameterized query to avoid
SQL Injection issues.
SqlCommand command = new SqlCommand("select name from table1 where id=@id", conn);
command.Parameters.AddWithValue("@id", comboBox1.SelectedValue);