I have a little problem with Entity Framework 6.
My application is a WPF C# application, I use SQL SERVER 2012 Express.
I try to insert data into my Person table.
It was working for a long time. Today I had an error : receiving an invalid column length from the client 46.
I searched and found some articles, they are talking about column sizes etc but in my case, tis is not the problem.
This code was working : dc.BulkInsert(listToInsert, options);
**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<Person>(listToInsert, options); // at this moment I have this error message : receiving an invalid column length from the client 46.
dc.SaveChanges();
}
I checked the data length of items, I didn't see any problem.
Does anyone have an idea ?
Thanks.