D
douglas
I would like to know how to access the last row in a dataset using the
following
logic. (*Note: the line of code that says 'do something is where I want to
access the last row in the dataset. )
**Note I am using visual basic.net 2005 professional version at work
dim da As New SqlDataAdapter
Dim ds As New DataSet()
da = New SqlDataAdapter(sqlCmd)
sqlCmd.Connection = New SqlConnection(connectionString)
sqlCnn.Open()
da = New SqlDataAdapter(sqlCmd)
sqlCmd.CommandText = sqlCmd.CommandType = CommandType.StoredProcedure
da.Fill(ds)
strholdnumber = 'gets a value
Dim IntTotalRows As Integer = ds.Tables(0).Rows.Count
Dim intFileRows As Integer = UBound(aryFi)
For A = 0 To ds.Tables(0).Rows.Count - 1
For intCntr = 0 To UBound(aryFi) Step 1
If Trim(strholdnumber) = Case(Mid(aryFi(intCntr).Name, 12,5 ))
'do something
End If
Next intCntr
next
the line of code that says: For A = 0 To ds.Tables(0).Rows.Count - 1
,keeps me from accessing the last line.
Thanks!
following
logic. (*Note: the line of code that says 'do something is where I want to
access the last row in the dataset. )
**Note I am using visual basic.net 2005 professional version at work
dim da As New SqlDataAdapter
Dim ds As New DataSet()
da = New SqlDataAdapter(sqlCmd)
sqlCmd.Connection = New SqlConnection(connectionString)
sqlCnn.Open()
da = New SqlDataAdapter(sqlCmd)
sqlCmd.CommandText = sqlCmd.CommandType = CommandType.StoredProcedure
da.Fill(ds)
strholdnumber = 'gets a value
Dim IntTotalRows As Integer = ds.Tables(0).Rows.Count
Dim intFileRows As Integer = UBound(aryFi)
For A = 0 To ds.Tables(0).Rows.Count - 1
For intCntr = 0 To UBound(aryFi) Step 1
If Trim(strholdnumber) = Case(Mid(aryFi(intCntr).Name, 12,5 ))
'do something
End If
Next intCntr
next
the line of code that says: For A = 0 To ds.Tables(0).Rows.Count - 1
,keeps me from accessing the last line.
Thanks!