zzzprojects / Bulk-Operations

C# SQL Bulk Operations | High-performance C# bulk insert, update, delete and merge for SQL Server, SQL Azure, SQL Compact, MySQL, and SQLite.
https://bulk-operations.net
142 stars 36 forks source link

BulkInsert with DataRowState.Added and AutoMapOutputIdentity fails #48

Closed ulfrudalv closed 5 years ago

ulfrudalv commented 5 years ago

I'm trying to use BulkInsert to only insert added rows in a DataTable together with AutoMapOutputIdentity. It throws a NullReferenceException which does not say anything anout the problem. If I skip the DataRowState parameter then it works. It is easy to reproduce by changing the call to BulkInsert in https://dotnetfiddle.net/g5pSS1 (row 40) to include DataRowState.Added.

JonathanMagnan commented 5 years ago

Hello @ulfrudalv ,

Thank you for reporting,

We will look at this issue.

Best Regards,

Jonathan

JonathanMagnan commented 5 years ago

Hello @ulfrudalv ,

The v2.15.8 has been released.

This issue should now be fixed in this new version, a null check was missed when using our library with DataRowState.

Let me know if everything works as expected.

ulfrudalv commented 5 years ago

Hello Jonathan Thank you for quick feedback! That solved my problem.

Best Regards Ulf