This project has moved. For the latest updates, please go here.


Abort in SqlCeBulkCopy.RowsCopied seems not work


it seem when eventArgs.Abort is set to true, the Copy job isn't aborted.

bulkCopy.BatchSize = 100;
bulkCopy.NotifyAfter = 100;
bulkCopy.RowsCopied += delegate(object sender, SqlCeRowsCopiedEventArgs eventArgs)
                eventArgs.Abort = true;
If we have 100000 Records to copy than the job dosn't abort after 100 Records.
Closed Apr 23, 2016 at 7:45 AM by ErikEJ


ErikEJ wrote Mar 23, 2016 at 9:48 AM

I think that Abort is not supported at all, and should be removed from the eventargs...

wrote Mar 23, 2016 at 9:48 AM

Amboryus wrote Mar 24, 2016 at 7:29 AM

OK, thanks for the quick answer.

Have you a good Idea what i can do to abort the copy job?

I start the copy job inside a backgroundworker. when i clicked on cancel then the backgroundworker is flaged for canceling. I used this property to abort a copy job with "SqlBulkCopy and the Property Abort". That works fine in this case.

My goal is to delete the *.sdf File when i cancel the job.

Amboryus wrote Mar 24, 2016 at 8:04 AM

I was to fast. Sorry.

I throw a User Exception in the descripted case now.
That works.

But, absoulutly nice work what you have done !!!!

Thanks !!!!

ErikEJ wrote Mar 24, 2016 at 3:55 PM

So I can close this now?

wrote Apr 23, 2016 at 7:45 AM