【问题标题】:does OnAutoGeneratingColumn e.cancel affect Table.Column.Count?OnAutoGeneratingColumn e.cancel 会影响 Table.Column.Count 吗?
【发布时间】: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];
    }
}

【问题讨论】:

    标签: c# mysql wpf


    【解决方案1】:

    不!我弄清楚了为什么我会出错,但这不是原因。您可以取消 wpf 数据网格中的列生成,而无需实际更改表索引。事后看来,这很明显。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-01-11
      • 2021-04-29
      • 2015-11-28
      • 2011-04-03
      • 2021-04-03
      • 2012-02-04
      相关资源
      最近更新 更多