VB Code Not Entering Loop

I don't know if you solved this problem yet or not but I usually structure my loops as follows:

Dim LineRow As CustShipDataSet.ShipDtlRow
For Each LineRow In adShip.CustShipData.ShipDtl
If LineRow.PackLine = pckLine Then
lotnum = LineRow.LotNum
End If
Next

Now my question for you. I have not been able to figure out the proper structure for GetList in version 9. I see that you use it in the snippet... did that work?

--- In vantage@yahoogroups.com, "jeffery_p_sanders" <jps@...> wrote:
>
> Thanks for the information. I added your code and it returns :
>
> "Tables(SubShipH) is something"
>
> and
>
> "Rows count = 0"
>
> I do not understand this as there are rows in the database for that vendor number.
>
> At least I now know where to start looking...Thanks!
>
> Jeff Sanders
>
>
>
>
> --- In vantage@yahoogroups.com, "rhecksabre" <rheck@> wrote:
> >
> > Not sure, but you may try adding this to make sure you have something to loop over:
> >
> > 'to make sure you get an object and get into loop
> > if isNothing(ShipADP.SubConShipEntryData.Tables("SubShipH")) then
> > MessageBox.Show("Tables(SubShipH) is nothing")
> > else
> > MessageBox.Show("Tables(SubShipH) is something")
> > 'to make sure there are rows
> > MessageBox.Show("Rows count = " & ShipADP.SubConShipEntryData.Tables("SubShipH").Rows.Count)
> >
> > end if
> >
> >
> > > for each row as DataRow in ShipADP.SubConShipEntryData.Tables("SubShipH").Rows
> > > venNum = row("VendorNum")
> > > messagebox.show("VenNum=" & cstr(venNum))
> > > next row
> > >
> >
> >
> > --- In vantage@yahoogroups.com, "jeffery_p_sanders" <jps@> wrote:
> > >
> > > Can anyone tell me what I am doing wrong in the for each loop shown below?
> > >
> > > Private Sub epiUltraComboC1_RowSelected(ByVal sender As Object, ByVal args As Infragistics.Win.UltraWinGrid.RowSelectedEventArgs)
> > > ' ** Place Event Handling Code Here **
> > > System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.WaitCursor
> > >
> > > epiNumericEditorC1.ResetValue()
> > > epiTextBoxC1.Clear()
> > > epiUltraGridC1.ResetBindings()
> > >
> > > dim vID as string
> > > dim vNum as integer
> > > dim vNam as string
> > > vID = epiUltraComboC1.value
> > > Dim vendorADP As VendorAdapter = New VendorAdapter(UD05Form)
> > > vendorADP.BOConnect()
> > > Dim gotVendor As Boolean = vendorADP.GetByID(vID)
> > > Dim vTable As DataTable = VendorADP.VendorData.Vendor.DataSet.Tables.Item(0)
> > > vNum = vTable.rows(0)("VendorNum")
> > > vNam = vTable.rows(0)("Name")
> > > epiTextBoxC1.text = vNam
> > > epiNumericEditorC1.value = vNum
> > > vendorADP.Dispose()
> > >
> > > Dim ShipADP as SubConShipEntryAdapter = New SubConShipEntryAdapter(UD05Form)
> > > ShipADP.BOConnect()
> > > Dim opts As SearchOptions = New SearchOptions(SearchMode.AutoSearch)
> > > opts.NamedSearch.WhereClauses.Add("VendorNum",vNum)
> > > Dim MorePages as boolean
> > > Dim ShipDS As Data.DataSet = ShipADP.GetList(opts, MorePages)
> > >
> > > EpiUltraGridC1.dataSource = ShipDS
> > >
> > > dim venNum as int32
> > >
> > > for each row as DataRow in ShipADP.SubConShipEntryData.Tables("SubShipH").Rows
> > > venNum = row("VendorNum")
> > > messagebox.show("VenNum=" & cstr(venNum))
> > > next row
> > >
> > > ShipADP.Dispose()
> > > System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Arrow
> > > End Sub
> > >
> > > Thanks,
> > > Jeff Sanders
> > >
> >
>
Can anyone tell me what I am doing wrong in the for each loop shown below?

Private Sub epiUltraComboC1_RowSelected(ByVal sender As Object, ByVal args As Infragistics.Win.UltraWinGrid.RowSelectedEventArgs)
' ** Place Event Handling Code Here **
System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.WaitCursor

epiNumericEditorC1.ResetValue()
epiTextBoxC1.Clear()
epiUltraGridC1.ResetBindings()

dim vID as string
dim vNum as integer
dim vNam as string
vID = epiUltraComboC1.value
Dim vendorADP As VendorAdapter = New VendorAdapter(UD05Form)
vendorADP.BOConnect()
Dim gotVendor As Boolean = vendorADP.GetByID(vID)
Dim vTable As DataTable = VendorADP.VendorData.Vendor.DataSet.Tables.Item(0)
vNum = vTable.rows(0)("VendorNum")
vNam = vTable.rows(0)("Name")
epiTextBoxC1.text = vNam
epiNumericEditorC1.value = vNum
vendorADP.Dispose()

Dim ShipADP as SubConShipEntryAdapter = New SubConShipEntryAdapter(UD05Form)
ShipADP.BOConnect()
Dim opts As SearchOptions = New SearchOptions(SearchMode.AutoSearch)
opts.NamedSearch.WhereClauses.Add("VendorNum",vNum)
Dim MorePages as boolean
Dim ShipDS As Data.DataSet = ShipADP.GetList(opts, MorePages)

EpiUltraGridC1.dataSource = ShipDS

dim venNum as int32

for each row as DataRow in ShipADP.SubConShipEntryData.Tables("SubShipH").Rows
venNum = row("VendorNum")
messagebox.show("VenNum=" & cstr(venNum))
next row

ShipADP.Dispose()
System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Arrow
End Sub

Thanks,
Jeff Sanders
Not sure, but you may try adding this to make sure you have something to loop over:

'to make sure you get an object and get into loop
if isNothing(ShipADP.SubConShipEntryData.Tables("SubShipH")) then
MessageBox.Show("Tables(SubShipH) is nothing")
else
MessageBox.Show("Tables(SubShipH) is something")
'to make sure there are rows
MessageBox.Show("Rows count = " & ShipADP.SubConShipEntryData.Tables("SubShipH").Rows.Count)

end if


> for each row as DataRow in ShipADP.SubConShipEntryData.Tables("SubShipH").Rows
> venNum = row("VendorNum")
> messagebox.show("VenNum=" & cstr(venNum))
> next row
>


--- In vantage@yahoogroups.com, "jeffery_p_sanders" <jps@...> wrote:
>
> Can anyone tell me what I am doing wrong in the for each loop shown below?
>
> Private Sub epiUltraComboC1_RowSelected(ByVal sender As Object, ByVal args As Infragistics.Win.UltraWinGrid.RowSelectedEventArgs)
> ' ** Place Event Handling Code Here **
> System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.WaitCursor
>
> epiNumericEditorC1.ResetValue()
> epiTextBoxC1.Clear()
> epiUltraGridC1.ResetBindings()
>
> dim vID as string
> dim vNum as integer
> dim vNam as string
> vID = epiUltraComboC1.value
> Dim vendorADP As VendorAdapter = New VendorAdapter(UD05Form)
> vendorADP.BOConnect()
> Dim gotVendor As Boolean = vendorADP.GetByID(vID)
> Dim vTable As DataTable = VendorADP.VendorData.Vendor.DataSet.Tables.Item(0)
> vNum = vTable.rows(0)("VendorNum")
> vNam = vTable.rows(0)("Name")
> epiTextBoxC1.text = vNam
> epiNumericEditorC1.value = vNum
> vendorADP.Dispose()
>
> Dim ShipADP as SubConShipEntryAdapter = New SubConShipEntryAdapter(UD05Form)
> ShipADP.BOConnect()
> Dim opts As SearchOptions = New SearchOptions(SearchMode.AutoSearch)
> opts.NamedSearch.WhereClauses.Add("VendorNum",vNum)
> Dim MorePages as boolean
> Dim ShipDS As Data.DataSet = ShipADP.GetList(opts, MorePages)
>
> EpiUltraGridC1.dataSource = ShipDS
>
> dim venNum as int32
>
> for each row as DataRow in ShipADP.SubConShipEntryData.Tables("SubShipH").Rows
> venNum = row("VendorNum")
> messagebox.show("VenNum=" & cstr(venNum))
> next row
>
> ShipADP.Dispose()
> System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Arrow
> End Sub
>
> Thanks,
> Jeff Sanders
>
Thanks for the information. I added your code and it returns :

"Tables(SubShipH) is something"

and

"Rows count = 0"

I do not understand this as there are rows in the database for that vendor number.

At least I now know where to start looking...Thanks!

Jeff Sanders




--- In vantage@yahoogroups.com, "rhecksabre" <rheck@...> wrote:
>
> Not sure, but you may try adding this to make sure you have something to loop over:
>
> 'to make sure you get an object and get into loop
> if isNothing(ShipADP.SubConShipEntryData.Tables("SubShipH")) then
> MessageBox.Show("Tables(SubShipH) is nothing")
> else
> MessageBox.Show("Tables(SubShipH) is something")
> 'to make sure there are rows
> MessageBox.Show("Rows count = " & ShipADP.SubConShipEntryData.Tables("SubShipH").Rows.Count)
>
> end if
>
>
> > for each row as DataRow in ShipADP.SubConShipEntryData.Tables("SubShipH").Rows
> > venNum = row("VendorNum")
> > messagebox.show("VenNum=" & cstr(venNum))
> > next row
> >
>
>
> --- In vantage@yahoogroups.com, "jeffery_p_sanders" <jps@> wrote:
> >
> > Can anyone tell me what I am doing wrong in the for each loop shown below?
> >
> > Private Sub epiUltraComboC1_RowSelected(ByVal sender As Object, ByVal args As Infragistics.Win.UltraWinGrid.RowSelectedEventArgs)
> > ' ** Place Event Handling Code Here **
> > System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.WaitCursor
> >
> > epiNumericEditorC1.ResetValue()
> > epiTextBoxC1.Clear()
> > epiUltraGridC1.ResetBindings()
> >
> > dim vID as string
> > dim vNum as integer
> > dim vNam as string
> > vID = epiUltraComboC1.value
> > Dim vendorADP As VendorAdapter = New VendorAdapter(UD05Form)
> > vendorADP.BOConnect()
> > Dim gotVendor As Boolean = vendorADP.GetByID(vID)
> > Dim vTable As DataTable = VendorADP.VendorData.Vendor.DataSet.Tables.Item(0)
> > vNum = vTable.rows(0)("VendorNum")
> > vNam = vTable.rows(0)("Name")
> > epiTextBoxC1.text = vNam
> > epiNumericEditorC1.value = vNum
> > vendorADP.Dispose()
> >
> > Dim ShipADP as SubConShipEntryAdapter = New SubConShipEntryAdapter(UD05Form)
> > ShipADP.BOConnect()
> > Dim opts As SearchOptions = New SearchOptions(SearchMode.AutoSearch)
> > opts.NamedSearch.WhereClauses.Add("VendorNum",vNum)
> > Dim MorePages as boolean
> > Dim ShipDS As Data.DataSet = ShipADP.GetList(opts, MorePages)
> >
> > EpiUltraGridC1.dataSource = ShipDS
> >
> > dim venNum as int32
> >
> > for each row as DataRow in ShipADP.SubConShipEntryData.Tables("SubShipH").Rows
> > venNum = row("VendorNum")
> > messagebox.show("VenNum=" & cstr(venNum))
> > next row
> >
> > ShipADP.Dispose()
> > System.Windows.Forms.Cursor.Current = System.Windows.Forms.Cursors.Arrow
> > End Sub
> >
> > Thanks,
> > Jeff Sanders
> >
>