I've been encountering this error Specified argument was out of the range of valid values. Parameter name: name
When im almost just copying the example here https://code.google.com/p/fast-member/
The error happens on the bcp.WriteToServer(reader), been looking for additional information but i still dont know what is causing the problem and the example is so simple... And i dont even know where the parameter named name is coming from.
My actual code is below
using (var bcp = new SqlBulkCopy(configvalue1))
using (var reader = ObjectReader.Create(DataToLoad, new string[]{"id","field1","field2","field3"}))
{
bcp.DestinationTableName = string.Format(DestinationTableFormat, DestinationDb, DestinationSchema, DestinationTable);
bcp.BatchSize = BatchSize ?? 10000;
bcp.WriteToServer(reader);
bcp.Close();
}
Can someone help?
Thanks in advance