i have a table employee. it has various attributes.(e_id,e_name,e_addr..) i have a data grid that displays all d values of employee..i need to now select multiple rows from the datagrid of employee such that only e_id gets inserted into another table.

is there an sql or vb code that can help me do this??

4 Years
Discussion Span
Last Post by ChrisPadgham

multiple rows of same employee? what will be returned that will be added to new table?

There is code for both but with more info we can determine what you need.


ok so i have a table employee(e_id,e_name,e_addr). it has currently 5 rows.(e_id=1 to e_id=5)

in datagrid i select 2 rows from table employee(i.e i select row 1 with e_id=1 and row 2 with e_id=2)

now i need to add only e_id to another table INFO. So now my table INFO should have values(1,2)

have you understood the problem?


you could perhaps add another column called "selected" to your employee table which is a Yes/No value that users can check. Then have a piece of SQL to insert the employee ids of the selected values into the other table, somethings like

INSERT INTO newTable (EmployeeId) SELECT EmployeeId FROM Employee WHERE Selected=True
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.