Hi! I'm having a problem with my program here. I have several text boxes that display 12 rows in a dataset. The code I'm currently using for the scroll procedure is as follows:
For Each rowRows In dsDrawings.Tables(0).Rows
'Checks if the current row is requested and adds it to the appropriate text boxs
If intCount >= (Num - 11) And intCount <= Num Then
arrDNum(i).text = rowRows("dwg_number").ToString
arrRNum(i).text = rowRows("rev_number").ToString
arrClient(i).text = rowRows("company_name").ToString
arrTitleA(i).text = rowRows("title1").ToString
arrTitleB(i).text = rowRows("title2").ToString
arrDesc(i).text = rowRows("description").ToString
arrTag(i).text = rowRows("tag_number").ToString
arrDP(i).text = rowRows("dwg_path").ToString
If LastTag < Val(rowRows("tag_number")) Then
LastTag = Val(rowRows("tag_number").ToString)
End If
i = i + 1
ElseIf intCount > (Num + 11) Then
Exit For
End If
intCount = intCount + 1
Next
This checks for the number of times it's gone through the loop to be equal to the new value of the scroll bar. The problem is, with a large dataset(7000+ records), the further down you go, it gets a LOT slower. Now, I know WHY this happens, and I know that it SHOULD happen. I just need to know if maybe there's a better way to do this? There's got to be SOMETHING that's more effiscient!!!
For Each rowRows In dsDrawings.Tables(0).Rows
'Checks if the current row is requested and adds it to the appropriate text boxs
If intCount >= (Num - 11) And intCount <= Num Then
arrDNum(i).text = rowRows("dwg_number").ToString
arrRNum(i).text = rowRows("rev_number").ToString
arrClient(i).text = rowRows("company_name").ToString
arrTitleA(i).text = rowRows("title1").ToString
arrTitleB(i).text = rowRows("title2").ToString
arrDesc(i).text = rowRows("description").ToString
arrTag(i).text = rowRows("tag_number").ToString
arrDP(i).text = rowRows("dwg_path").ToString
If LastTag < Val(rowRows("tag_number")) Then
LastTag = Val(rowRows("tag_number").ToString)
End If
i = i + 1
ElseIf intCount > (Num + 11) Then
Exit For
End If
intCount = intCount + 1
Next
This checks for the number of times it's gone through the loop to be equal to the new value of the scroll bar. The problem is, with a large dataset(7000+ records), the further down you go, it gets a LOT slower. Now, I know WHY this happens, and I know that it SHOULD happen. I just need to know if maybe there's a better way to do this? There's got to be SOMETHING that's more effiscient!!!