遍历 VB.NET 中返回的数据集行

Looping through returned rows of dataset in VB.NET

我有一个用 VB.Net 编写的应用程序,它在 gridview 中显示来自 table 的数据。

 Dim DbaseDataSet As DreamApp.DbaseDataSet = CType(Me.FindResource("DbaseDataSet"), DreamApp.DbaseDataSet)
    Dim DbaseDataSetDevicesTableAdapter As DreamApp.DbaseDataSetTableAdapters.DevicesTableAdapter = New DreamApp.DbaseDataSetTableAdapters.DevicesTableAdapter()
    DbaseDataSetDevicesTableAdapter.Fill(DbaseDataSet.Devices)
    Dim DevicesViewSource1 As System.Windows.Data.CollectionViewSource = CType(Me.FindResource("DevicesViewSource1"), System.Windows.Data.CollectionViewSource)
    DevicesViewSource1.View.MoveCurrentToFirst()

查询哪个 returns 值是:

SELECT [Name], [Username], [Password], [IP], [Type], [Curr] FROM [Devices]

我的 table 填入了正确的数据。 我将如何遍历返回的行以进行每个循环,并使用上面查询的返回值 运行 为每个返回的行编写一段代码。

直接循环 Rows 属性

For each drRow as Datarow in DbaseDataSet.Devices.Rows

....
'DrRow("colname") = something

Next