I am racking my brain on this. Basically, I am taking data from one table and inserting it into another. However when it loops thru the second time it will not see the second guid and the watch still says the first. Then it crashes and says it cannot find table 0. What am i doing wrong? Thanks in advance.
Code:
If tempds.Tables(0).Rows.Count > 0 Then
Dim x As Integer
upbProgress.Maximum = tempds.Tables(0).Rows.Count
For x = 0 To tempds.Tables(0).Rows.Count - 1
upbProgress.Value = x
upbProgress.Text = "Starting Conversion"
upbProgress.Update()
Me.Refresh()
'- converts xxxxxx table to xxxxxx table format
Dim TheGuid As String = tempds.Tables(0).Rows(x).Item("GUID")
Dim TheFilenameIn As String = TheGuid
Dim TheOCRType As String = "PDF"
Dim TheStatus As String = "Pending"
SuperDataAccess.ClearParams()
SuperDataAccess.FillDataSet_SQL(tempds, "Table1", sp.WaveOCR_ins(TheGuid, TheFilenameIn, "", TheOCRType, "", TheStatus, Date.Now, Date.Now))
SuperDataAccess.ClearParams()
'TheFilenameIn = Nothing
'TheGuid = Nothing
'Me.Update()
'Me.Refresh()
Next
End If
Code:
If tempds.Tables(0).Rows.Count > 0 Then
Dim x As Integer
upbProgress.Maximum = tempds.Tables(0).Rows.Count
For x = 0 To tempds.Tables(0).Rows.Count - 1
upbProgress.Value = x
upbProgress.Text = "Starting Conversion"
upbProgress.Update()
Me.Refresh()
'- converts xxxxxx table to xxxxxx table format
Dim TheGuid As String = tempds.Tables(0).Rows(x).Item("GUID")
Dim TheFilenameIn As String = TheGuid
Dim TheOCRType As String = "PDF"
Dim TheStatus As String = "Pending"
SuperDataAccess.ClearParams()
SuperDataAccess.FillDataSet_SQL(tempds, "Table1", sp.WaveOCR_ins(TheGuid, TheFilenameIn, "", TheOCRType, "", TheStatus, Date.Now, Date.Now))
SuperDataAccess.ClearParams()
'TheFilenameIn = Nothing
'TheGuid = Nothing
'Me.Update()
'Me.Refresh()
Next
End If