Monday, March 26, 2012

working with dataviews

If I have a dataview that I run a filter on. How can I run an if statement on a column for that perticular row?


Dim dvwlogin as DataView
For Each row In empDS.Tables("allocations").Rows

dvwlogin = empDS.Tables("employeeinfo").DefaultView
dvwlogin.RowFilter = "loginID=" & empDS.Tables("allocations").Rows(i).Item("loginID")

next

I want to run some type of an if statement based on a column from that filtered row. How would that look?


Dim RowCount As Integer
Dim NextRow As DataRowView
For RowCount = 0 To dvwlogin.Count - 1
NextRow = dvwlogin(RowCount)
If NextRow("ID") = 1 Then
'Blah Blah Blah
End If
Next

Or whatever. You can also use the DataRowView.Row property to access the underlying DataRow.

AutoFed

0 comments:

Post a Comment