Alex Rivera | Logout

Is there a way to use SqlBulkCopy without converting the data to a DataTable?

Asked 2009-11-19T00:41:06.370
9

Is there a way to use SqlBulkCopy without converting the data to a DataTable? I have a list of objects (List) in RAM and I really don't want to use more memory to create the DataTable. Could it be possible to implement IDataReader on a List?

Thanks!

Edit
Report

1 Answer

0

As you move each object into a DataTable, delete it from the List, and and you can then use SqlBulkCopy with just a little extra memory.

Then, when you are done, reverse it.

Personally, I would just create a DataTable as memory is cheap.

answered 2009-11-19T01:17:36.283

Your Answer