循环访问 DataView 中的行
DataView
对象没有像 DataTable
那样的 Rows
属性。
如何循环遍历 DataView 的行?
The DataView
object doesn't have a Rows
property like DataTable
.
How do I loop through the rows of a DataView?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
DataView 对象本身用于循环遍历DataView 行。
DataView 行由 DataRowView 对象表示。 DataRowView.Row 属性提供对原始数据表行。
C#
VB.NET
The DataView object itself is used to loop through DataView rows.
DataView rows are represented by the DataRowView object. The DataRowView.Row property provides access to the original DataTable row.
C#
VB.NET
我更喜欢以更直接的方式来做这件事。它没有行,但仍然有行数组。
I prefer to do it in a more direct fashion. It does not have the Rows but is still has the array of rows.
您可以通过
Indexer
将DefaultView
迭代为以下代码:You can iterate
DefaultView
as the following code byIndexer
: