SQLBulkCopy used in conjunction with Transaction and firing an event each time a batch is copied
- by Hans Rudel
Im currently uploading data to MS SQL server via SQLBulkCopy and Transactions. I would like to be able to raise an event after each batch has been uploaded (I have already tried SQLRowsCopied event and it doesnt work, see quote below)
MSDN quote:
No action, such as transaction activity, is supported in the connection during the execution of the bulk copy operation, and it is recommended that you not use the same connection used during the SqlRowsCopied event. However, you can open a different connection.
http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlbulkcopy.sqlrowscopied(v=vs.80).aspx
So i basically cant have my cake and eat it :( Does anyone know a solution around this as i would like to fire an event after each batch has been uploaded.
Thanks for your help.