[英]Is there a limit to the number of rows that can be added to a DataTable in c#?
[英]C# Number of deleted rows in DataTable
我有一个数据表,我通过它删除了几行
bindTable.Rows[index].Delete();
在稍后的阶段,我想知道以这种方式删除了多少行。 我知道我可以遍历bindTable.Rows并计算已删除状态下的行,但是有没有更直接的方法呢?
不,但是另一种方法可以是DataTable.RowDeleted事件
int rowDeletedCount = 0;
...
bindTable.RowDeleted += (o, e) => rowDeletedCount++;
我认为最实用的方法还是您的答案或计算示例代码中删除迭代的次数。
私人诠释deleteRowCount;
bindTable.Rows [index] .Delete();
deleteRowCount ++;
问候,
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.