【发布时间】:2018-02-01 18:27:33
【问题描述】:
如果我使用 OnAutoGeneratingColumn 取消一些我不一定要生成的列,会不会影响 Table.Columns.Count 中的列数?
上下文
我正在逐行遍历表,获取每个值并将其传递给插入 SQL 命令。现在它排成一行,以便每个条目都正确关联。我会用 e.cancel 破坏这个吗?如果 row[0] 被取消,row[1] 将不再指向它曾经做过的事情吗?
for (int i = 0; i < table.Dummy.Columns.Count; i++)
{
// if we're past our first entry, add room for the next before entering it
if (i != 0)
{
InsertIntoTableQuery.AddIntPrm();
}
//if our column has an entry, add it into our table.
if (row[i] != null)
{
InsertIntoTableQuery.Prms[i].Val = row[i];
}
}
【问题讨论】: