How to create a copy of a row?

Cricket

Active member
Joined
Jan 6, 2005
Messages
28
Location
Hamilton, ON, Canada
Programming Experience
5-10
I've created a Sub that uses a row passed to it to add it to another table. However when I try and add the row to the other table I recieve an error stating that this row already belongs to another table. Well of course it does, I want a copy of it in this new table!!!!!

How do I get a copy of this row so that I can add it to this new table?
 

TPM

Well-known member
Joined
Dec 7, 2004
Messages
623
Location
CA
Programming Experience
3-5
Well you could loop through each cell and copy the value to an array, then add the array to the new table.

TPM
 

Paszt

Staff member
Joined
Jun 3, 2004
Messages
1,500
Location
Raleigh, NC - USA
Programming Experience
Beginner
Use the dataTable.ImportRow method.

Also of interest is the dataTable.Clone function which makes a copy of the table structure (or schema).
 
Top Bottom