API documentation in HTML format is available for download sqlcebulkcopydoc.1.1.zip

Last edited Aug 16, 2011 at 8:01 AM by ErikEJ, version 3

Comments

flobadob Mar 5, 2015 at 11:13 AM 
One can combine the SqlBulkCopy and the SqlCeBulkCopy quite easily by taking Jarod Ferguson's sample code from here...
http://elegantcode.com/2012/01/26/sqlbulkcopy-for-generic-listt-useful-for-entity-framework-nhibernate/

And altering the first few lines to this...

public static void BulkInsert<T>(string connection, string tableName, IList<T> list, MetadataConnectionType connectionType)
{
dynamic bulkCopy = null;
if (connectionType == MetadataConnectionType.MicrosoftSqlExpress)
bulkCopy = new SqlBulkCopy(connection);
else if (connectionType == MetadataConnectionType.MicrosoftSqlCompactEdition)
bulkCopy = new ErikEJ.SqlCe.SqlCeBulkCopy(connection);

where connectionType is just an enum.

flobadob Mar 5, 2015 at 9:40 AM 
Hi Erik, the link to the docs is currently broken.