<p>What is the fastest way of transferring few thousand rows of data from one DataTable to another? Would be great to see some sample code snippets.</p>

<p>Edit: I need to explain a bit more. There is a filtering condition for copying the rows. So, a plain Copy() will not work.</p>

[{'answer_id': 67939, 'author': 'GEOCHET', 'author_id': 5640, 'author_profile': 'https://Stackoverflow.com/users/5640', 'pm_score': 2, 'selected': False, 'text': '<p>What is wrong with <a href="http://msdn.microsoft.com/en-us/library/system.data.datatable.copy.aspx" rel="nofollow noreferrer">DataTable.Copy</a>?</p>\n'}, {'answer_id': 67989, 'author': 'Eugene Katz', 'author_id': 1533, 'author_profile': 'https://Stackoverflow.com/users/1533', 'pm_score': 4, 'selected': True, 'text': '<p>You can\'t copy the whole table, you need to copy one rows.  From <a href="http://support.microsoft.com/kb/308909" rel="noreferrer">http://support.microsoft.com/kb/308909</a> (sample code if you follow the link)</p>\n\n<p>"How to Copy DataRows Between DataTables\nBefore you use the ImportRow method, you must ensure that the target table has the identical structure as the source table. This sample uses the Clone method of DataTable class to copy the structure of the DataTable, including all DataTable schemas, relations, and constraints.</p>\n\n<p>This sample uses the Products table that is included with the Microsoft SQL Server Northwind database. The first five rows are copied from the Products table to another table that is created in memory."</p>\n'}, {'answer_id': 68022, 'author': 'Alex Lyman', 'author_id': 5897, 'author_profile': 'https://Stackoverflow.com/users/5897', 'pm_score': 2, 'selected': False, 'text': '<p>Copying rows to a table throws some flags at me.  I\'ve seen people try this before, and in every single case what they really wanted was a <a href="https://learn.microsoft.com/en-us/dotnet/api/system.data.datatable.copy" rel="nofollow noreferrer">System.Data.DataView</a>.  You really should check to see if the <a href="https://learn.microsoft.com/en-us/dotnet/api/system.data.dataview.rowfilter" rel="nofollow noreferrer">RowFilter</a> property will do what you need it to do.</p>\n'}]
['https://Stackoverflow.com/questions/67929', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/10476/']