1

I've installed DataAccessApplicationBlock.msi and I got the Microsoft.ApplicationBlocks.Data.dll file into my bin folder. I found every other sqlhelper methods except ExecuteBulkCopy.

How do I add ExecuteBulkCopy function to the SqlHelper class?

pnuts
  • 58,317
  • 11
  • 87
  • 139
ACP
  • 34,682
  • 100
  • 231
  • 371

1 Answers1

1

Isn't that block an abstraction over the database? What would the code do if it wasn't SQL-Server? I personally don't think it makes sense to encapsulate this in a general-purpose (and database-neutral) library.

Also; it is pretty basic functionality, so you shouldn't have any problem writing a method for the basic scenario that accepts a connection-string, table name, and IDataReader / DataTable. In non-trivial usage is has lots of configuration options (column mapping, events, etc), and probably doesn't warrant wrapping.

To be honest, while I use SqlBulkCopy, I don't use it often enough (or similarly enough) to warrant hiding it away. Perhaps just use SqlBulkCopy directly in your repository / DAL / whatever code?

Marc Gravell
  • 1,026,079
  • 266
  • 2,566
  • 2,900