3

I'm developing an application (.Net Core 3.1, C# 8) that is using Entity Framework Core and the EFCore.BulkExtensions NuGet package to manage bulk queries. The project is database first. The columns in the table are floats and null is allowed in the database, so it's mapped to double?.

I have a table with 6 float columns, that are mapped to 6 nullable double properties. My logic can generate 2 kinds of outputs: (1) when it generates a proper double value like 3.14 and (2) when the result is null.

I'm getting the following error message when I'm using the BulkInsert() method:

Microsoft.Data.SqlClient.SqlException: 'OLE DB provider 'STREAM' for linked server '(null)' returned invalid data for column '[!BulkInsert].CUSTOMER_SCORES'.'

Mark Szabo
  • 8,515
  • 3
  • 18
  • 26
Szabolcs Kun
  • 63
  • 1
  • 7
  • Looks like related https://stackoverflow.com/questions/23229862/weird-ole-db-provider-stream-for-linked-server-null-returned-invalid-data If you still facing problems, better to create issue on library's site. Or find better bulk extension. – Svyatoslav Danyliv Nov 02 '20 at 11:08
  • I walked through this thread, and I haven't find the solution there. – Szabolcs Kun Nov 02 '20 at 11:13
  • I would suggest to try this extension https://github.com/linq2db/linq2db.EntityFrameworkCore and try `context.BulkCopy` with overloads and tweaking options. – Svyatoslav Danyliv Nov 02 '20 at 11:16

0 Answers0