Ich habe ein kleines Problem mit dem Entitäts -Framework 6. < /p>
Meine Anwendung ist eine WPF C# -Anwendung. Ich verwende SQL Server 2012 Express. Heute hatte ich einen Fehler: Erhielt eine ungültige Spaltenlänge vom Client 46. **using EntityFramework.BulkInsert.Extensions;**
//I have a list of person object to insert.
var listToInsert = PersonList.Where(ro => !ExistingPerson.Contains(ro.Pers_Code.ToLower())).ToList();
using(MyEntities dc = new MyEntities())
{
*//If I add items one by one, it works*
foreach (var item in listToInsert)
{
dc.Person.Add(item);
}
dc.SaveChanges(); //Success.
//But If I use Bulkinsert, I have an error message
BulkInsertOptions options = new BulkInsertOptions();
options.BatchSize = 1000;
dc.BulkInsert
(listToInsert, options); // at this moment I have this error message : receiving an invalid column length from the client 46.
dc.SaveChanges();
}
< /code>
Ich habe die Datenlänge der Elemente überprüft, ich habe kein Problem gesehen. < /p>
Hat jemand eine Idee? < /p>
Thanks.
Entity Framework 6 Bulkinsert empfängt eine ungültige Spaltenlänge vom Client SQL Server 2012 Express ⇐ C#
-
- Similar Topics
- Replies
- Views
- Last post