Having a brain cramp here...
I am accessing a dataset with a data table called "lineitem". There will probably be more than one record in this table, and I need to execute some processing against one of them, specified by the line item number (sLINum).
So what I want to do is iterate through the table and look for the record with the same line item number, then capture the index value so I can use it when processing the right record going forward.
But I can't figure out how to get to the index value. I've included some sample code below to show mmy thought process:
Public Sub Foo(dsLineItem as DataSet, sLINum As String)
Dim dtLI As DataTable
Dim drLI As DataRow
Dim idxLI As Short
dtLI = dsLineItem.Tables("lineitem")
For Each drLI In dtLI.Rows
If drLI("LineItemNum").ToString = sLINum Then
idxLI = drli.<capture index value here?>
Exit For
End If
Next
Any help (or an alternate way to do this) would be appreiciated. Thanks.
CraigHartz
I am accessing a dataset with a data table called "lineitem". There will probably be more than one record in this table, and I need to execute some processing against one of them, specified by the line item number (sLINum).
So what I want to do is iterate through the table and look for the record with the same line item number, then capture the index value so I can use it when processing the right record going forward.
But I can't figure out how to get to the index value. I've included some sample code below to show mmy thought process:
Public Sub Foo(dsLineItem as DataSet, sLINum As String)
Dim dtLI As DataTable
Dim drLI As DataRow
Dim idxLI As Short
dtLI = dsLineItem.Tables("lineitem")
For Each drLI In dtLI.Rows
If drLI("LineItemNum").ToString = sLINum Then
idxLI = drli.<capture index value here?>
Exit For
End If
Next
Any help (or an alternate way to do this) would be appreiciated. Thanks.
CraigHartz