通过行的数据视图循环 [英] Looping through rows in a DataView

查看:126
本文介绍了通过行的数据视图循环的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

数据视图对象没有一个 DataTable属性

如何通过数据视图的行做我循环?

How do I loop through the rows of a DataView?

推荐答案

该数据视图对象本身是通过数据视图行用于循环。

The DataView object itself is used to loop through DataView rows.

数据视图行再由的DataRowView 对象psented $ P $。该 DataRowView.Row 属性提供访问原始数据表中的行。

DataView rows are represented by the DataRowView object. The DataRowView.Row property provides access to the original DataTable row.

C#

foreach (DataRowView rowView in dataView)
{
    DataRow row = rowView.Row;
    // Do something //
}

VB.NET

For Each rowView As DataRowView in dataView
    Dim row As DataRow = rowView.Row
    ' Do something '
Next

这篇关于通过行的数据视图循环的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆