How to batch insert lots of rows using Enterprise Library DAAB?

2.2k Views Asked by At

How can I execute 1000s of INSERT queries using Enterprise Library DAAB? That is to say how can I insert lots of rows into a table using DAAB all at once efficiently? And without using a for-loop. Thanks.

1

There are 1 best solutions below

2
On

Unfortunately, I'm not sure you can do that using the Enterprise Library DAAB without extending it. As an alternative you can use SqlBulkCopy.

http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlbulkcopy.aspx

EDIT

The Oracle Data Provider for .NET (ODP.NET) supports this via the Array Binding feature.

http://www.oracle.com/technetwork/issue-archive/2009/09-sep/o59odpnet-085168.html