如何循环遍历 DataView

发布于 2025-01-04 18:18:35 字数 415 浏览 1 评论 0原文

可能的重复:
循环访问 DataView 中的行

我已经从数据表创建了数据视图。

我的问题是如何在数据视图中循环?

我知道在数据表中我可以执行这样的循环:

For Each oRow as DataRow in iDataset.Tables("tableName")
     Msgbox oRow(0).ToString
Next

How do i do that for a DataView?

Possible Duplicate:
Looping through rows in a DataView

I have created a dataview from a datatable.

My question is how can I loop inside the dataview?

I know that in a datatable I can perform a loop like this:

For Each oRow as DataRow in iDataset.Tables("tableName")
     Msgbox oRow(0).ToString
Next

How do i do that for a DataView?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

谁人与我共长歌 2025-01-11 18:18:35

试试这个:

For Each rowView As DataRowView in dataView
    Dim row As DataRow = rowView.Row
    Msgbox oRow(0).ToString
Next

try this:

For Each rowView As DataRowView in dataView
    Dim row As DataRow = rowView.Row
    Msgbox oRow(0).ToString
Next
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文