Is it possible to utilize SqlBulkCopy without having to convert the data to a DataTable?

c# sqlbulkcopy sql-server

Question

Can SqlBulkCopy be used without first transforming the data to a DataTable? I already have a list of items (List) in RAM, therefore I really don't want to build the DataTable in extra memory. IDataReader on a List might be implemented, is it possible?

Thanks!

1
8
11/19/2009 12:41:06 AM

Popular Answer

Without a doubt, I would assume that you could.BulkDataReader required schema information, thus you cannot just provide aList If you create a class that utilizesIDataReader , which you'll include in yourGetSchemaTable implementation.

I would just make aDataTable Unless I could show a legitimate memory problem that would support the implementation, I would do it myself.

2
11/19/2009 12:52:16 AM


Related Questions





Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow