Question: I have this function which I am using to fill my combobox but its not getting filled. I am not getting any error either.

```
public List<string> showStudents()
        {
            List<string> list = new List<string>();
                string rollno;
                command = connection.CreateCommand(); //command and connection have been initialized earlier..
                command.CommandText = "select RollNo from student";
            try
            {                    
                connection.Open();                
                SqlDataReader reader = command.ExecuteReader();
                while (reader.Read())
                {                    
                    rollno = reader["RollNo"].ToString();
                    list.Add(rollno);
                }
                reader.Close();
                return list;
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                connection.Close();
            }
        }
    }
}

comboBox.DataSource=showStudents();

```

What may be the problem? Please help!!
Thank You..  

Have got the answer.. :)

```
foreach(string str in showStudent())
{
comboBox.Items.Add(str);
}

```

Answer: 
You'll need to declare the columns except the ID on both the `INSERT` and the `SELECT`, since the number of fields need to match, and `id` (as you noticed) can't be inserted as is into the destination table.

```
INSERT INTO DestTable (field1, field2, field3) 
    SELECT field1, field2, field3 FROM SourceTable;

```

[An SQLfiddle to test with](http://sqlfiddle.com/#!2/9fc34e/1).

EDIT: You *could* do it in a bit more hacky way to simplify the insert. You can create a trigger that simply forces the primary key to `NULL` on insert.

```
CREATE TRIGGER t_DT BEFORE INSERT ON DestTable 
FOR EACH ROW
  SET NEW.id = NULL;

```

then a copy from table to table can be done as simply;

```
INSERT INTO DestTable SELECT * FROM SourceTable;

```

[Another SQLfiddle](http://sqlfiddle.com/#!2/2c55a/1).
How about something like:

```
INSERT INTO products 
( 
  select products_temp.* FROM products_temp 
  where key not in (select key from products) 
)

```