我一直遇到这个错误 指定的参数超出了有效值的范围。参数名称:名称
当我几乎只是在这里复制示例时https://code.google.com/p/fast-member/
错误发生在 bcp.WriteToServer(reader) 上,一直在寻找其他信息,但我仍然不知道是什么导致了问题,而且示例非常简单......而且我什至不知道名为name的参数来自哪里。
我的实际代码如下
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();
}
有人可以帮忙吗?
提前致谢