Monday, March 12, 2012

How to copy a datatable to another specify column mapping

Hello,

Can any one show me how to copy the data in one datatable to another datatable? For example:

say from tableA .ColumnX to tableB.ColumnY

Thanks in advance for any suggestions.

You may wish to look into the bulk copy class featured in .Net 2.0 this can only be used with SQL Server. You can read morehere

You could also read from your current table and insert ino the new table using another command object. If you are unsure about doing this, reply to this thread and let me know which language you prefer and I'll post an example.

Good Luck


First make sure that the two columns are of the same size.Then may you use the sql statements--"Insert" to add the data column from Table B into Table A.

Maybe what I said was not correct,Please tell me.

Labels: , , , , , , , , , , ,

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home