mtanneryd / ef-bulk-operations

Bulk operations for Entity Framework 6

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

BulkUpdateAll with InsertIfNew - Operand type clash: datetime2 is incompatible with int with EF6

bsohi opened this issue · comments

commented

Hi,

Thanks for the tool. We are heavily using this as we are processing lots of data. We allow user to upload file and process 1000's of records and this tool really help us from performance wise.

While adding new table to support bulk operation, we are stumbled on below error on one of the table, which has 2 columns of datetime2(7) datatype not null. The same operation works for other table which has 3 columns of datetime2(7) data type but 2 of them are nullable.

BulkInsertAll is working fine for the table.

I have tried to re-create EDMX file but still same error.

Operand type clash: datetime2 is incompatible with int\r\nDatabase name 'tempdb' ignored, referencing object in
tempdb.\r\nDatabase name 'tempdb' ignored, referencing object in tempdb.

Getting this issue on one other table

Implicit conversion from data type datetime to int is not allowed. Use the CONVERT function to run this query.\r\nDatabase name 'tempdb' ignored, referencing object in tempdb.\r\nDatabase name 'tempdb' ignored, referencing object in tempdb.

Can you please check if this is issue or i am doing something wrong.

BulkUpdateRequest sbur = new BulkUpdateRequest();
sbur.KeyPropertyNames = keyPropertyNames;
sbur.UpdatedPropertyNames = updatePropertyNames;
sbur.InsertIfNew = true;
sbur.Entities = entities;
var sburesponse = _saasDB.BulkUpdateAll(sbur);

Thanks
Balwinder