Should i worry

ninjatalon

Member
Joined
Sep 22, 2010
Messages
24
Programming Experience
Beginner
I get this when I run a form that i dynamically add controls at certain locations.

A first chance exception of type 'System.IndexOutOfRangeException' occurred in Microsoft.VisualBasic.dll

It does not stop my program to work and works the way it should but i'm worried that it will cause an error when i make changes to my program
 
i started to put everything in comments and then uncomment them to find out the culprit. It ended being a procedure i have in a module.


Public Sub number_of_children()
Dim count As Integer = 0
Dim errorloop As Boolean = False


'This section is to determine how many labels and/or names will display on frmMeals
'--------------------------------------------------------------------------------------------------

Dim num_of_child As Integer = 0

Do While errorloop = False

Try

If Not get_child_dataset.Tables(0).Rows(count).ItemArray(1) & " " & get_child_dataset.Tables(0).Rows(count).ItemArray(3) = "" Then
num_of_child = num_of_child + 1
End If

Catch

errorloop = True
End Try

count = count + 1
Loop
set_num_of_children(num_of_child)
End Sub


I made this function because i couldn't find a way how to detect the amount of rows that are being used inside my database.
 
Back
Top