Copy DataTable Rows Fast?

  • Thread starter Thread starter lucius
  • Start date Start date
L

lucius

..NET Framework 2.0

I have a custom class inherits from DataTable. It has a method to "get
remote stuff" where it makes a web service call to a .NET 2.0 web
service that executes a TableAdapter. Now I need to just get the data
columns and rows from the TableAdapter into my lightweight class. I
think I want to do something like

RemoteTA.Call( param1 ).Rows.CopyTo

My DataTable does not have any columns or rows to start.

Thanks.
 
Hi Lucius,

Regarding on this issue, are you wantting to find a way to effeciently
import the Rows(get from remote webservice) into the custom DataTable?

Based on my understanding, the .NET 2.0 DataTable class provide several
means for us to copy or import rows into it:

** Use ImportRow to import rows from another table

** You can use DataTable.Load method to load data from a IDataReader
object, which can be created through DataTable.CreateDataReader

Also when load data into datatable, you should call BeginLoadData,
EndLoadData so as to turn off event notification(improve performance).


Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no rights.
 
Hi Lucius,

Does my last reply helps you some? If you still have any questions, please
feel free to post here.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no rights.
 
Back
Top