hi,
i have a botton called next for going through filtered records. so if the search yield 10 records i can only see the first 9 record and it will give me an error after i click the next botton to see the 10th record. anyone has any idea? the error message is "There is no row at position 10" but there are 10 records.
thank you.
i have a botton called next for going through filtered records. so if the search yield 10 records i can only see the first 9 record and it will give me an error after i click the next botton to see the 10th record. anyone has any idea? the error message is "There is no row at position 10" but there are 10 records.
thank you.
VB.NET:
Private Sub btmNext_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btmNext.Click
If dt4.Rows.Count = True Then
btmNext.Enabled = False
btmPrev.Enabled = True
Else
btmPrev.Enabled = True
btmNext.Enabled = True
int_count = int_count + 1
If int_count = dt4.Rows.Count Then
btmNext.Enabled = False
End If
lbldbcur.Text = int_count
lbldbCount.Text = dt4.Rows.Count
txtdbDivision.Text = ds4.Tables(0).Rows(int_count).Item(4)
txtdbPortNo.Text = ds4.Tables(0).Rows(int_count).Item(5)
txtdbWallStreet.Text = ds4.Tables(0).Rows(int_count).Item(12)
txtdbExp.Text = ds4.Tables(0).Rows(int_count).Item(2)
txtdbFamName.Text = ds4.Tables(0).Rows(int_count).Item(17)
txtdbPortName.Text = ds4.Tables(0).Rows(int_count).Item(3)
txtdbDom.Text = ds4.Tables(0).Rows(int_count).Item(27)
txtdbGuideLim.Text = Format(CSng(ds4.Tables(0).Rows(int_count).Item(7)), "$###,###,###,###,###,###")
txtdbCurRisk.Text = Format(CSng(ds4.Tables(0).Rows(int_count).Item(9)), "$###,###,###,###,###,###")
txtdbSetLim.Text = Format(CSng(ds4.Tables(0).Rows(int_count).Item(8)), "$###,###,###,###,###,###")
txtdbFundType.Text = ds4.Tables(0).Rows(int_count).Item(21)
txtdbInvMgr.Text = ds4.Tables(0).Rows(int_count).Item(11)
txtdbComments.Text = ds4.Tables(0).Rows(int_count).Item(23)
txtdbConf_Port.Text = ds4.Tables(0).Rows(int_count).Item(28)
txtdbLoc.Text = ds4.Tables(0).Rows(int_count).Item(6)
End If
End Sub