Thanks Brian,
The Object Explorer just has a system string called "Id" in that position. I have tried PartWhse, PartBin and PartQty but get the same answer each time - cannot find Table 0...
This bit of code is in a customisation of the View Costs function in the Engineering Workbench. Another adapter is working fine finding the average and standard costs on file.
Thanks for the suggestion. I will keep trying.
Neil Buckman
Information Technology
[Gibson Shopfitters]
DH Gibson Pty Ltd | 205-231 Fairfield Rd | YENNORA NSW 2161
Office 8724 4600 | Direct 8724 4618 | Fax 8724 4604 | Mobile 0413 125 994
nbuckman@...<mailto:nbuckman@...> | www.gibsonshopfitters.com.au <http://www.gibsonshopfitters.com.au/>
From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of Brian Roberts
Sent: Wednesday, 28 November 2012 8:57 AM
To: vantage@yahoogroups.com
Subject: RE: [Vantage] Trying to read stock on hand ...
This bit in your code: pohwa.GetData("YNRA")
Should be a table name instead of your plant code. As a guess, try "PartWhse" or "PartBin".
Brian.
From: vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com> [mailto:vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com>] On Behalf Of nbuckman@...<mailto:nbuckman%40ymail.com>
Sent: Tuesday, November 27, 2012 6:09 AM
To: vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com>
Subject: [Vantage] Trying to read stock on hand ...
Dear VB helpers,
Can anyone out there tell me where I am in the dark in the code below?
I just want to find out if there is stock on hand in the plant "YNRA".
This code falls over at the whadapterRow line, "Unable to find Table 0"
--------------------------------------------
Dim pohwa As PartOnHandWhseAdapter = New PartOnHandWhseAdapter(Me.oTrans)
pohwa.BOConnect()
Dim FoundWh As Boolean = pohwa.GetPartOnHandWhse(PartNum, "YNRA")
If FoundWh then
Try
Dim whds As System.Data.DataSet = pohwa.GetData("YNRA")
Dim whadapterRow As System.Data.DataRow = whds.Tables(0).Rows(0)
Dim QtyOh As Decimal = whadapterRow("OnHandQty")
EpiMessageBox.Show("On hand qty is " + QtyOH.toString())
Catch ex As System.Exception
ExceptionBox.Show(ex)
End Try
End If
---------------------------------------------
All suggestions welcome,
Thanks,
- Neil
[Non-text portions of this message have been removed]
Notice:This e-mail and any attachments are confidential and are only for the use of the person to whom they are addressed. If you are not the intended recipient please advise the sender by return e-mail and delete the message and any attachments. Any use, interference with, disclosure or copying of this message or any attachments is unauthorised and prohibited. The sender does not warrant that the information is free of a virus or any other defect or error, and any views expressed herein, unless specifically indicated otherwise, are those of the individual sender.
The DH Gibson Group of Companies - http://www.gibsonshopfitters.com.au
P Please consider our shared environment before printing this communication.
[Non-text portions of this message have been removed]
The Object Explorer just has a system string called "Id" in that position. I have tried PartWhse, PartBin and PartQty but get the same answer each time - cannot find Table 0...
This bit of code is in a customisation of the View Costs function in the Engineering Workbench. Another adapter is working fine finding the average and standard costs on file.
Thanks for the suggestion. I will keep trying.
Neil Buckman
Information Technology
[Gibson Shopfitters]
DH Gibson Pty Ltd | 205-231 Fairfield Rd | YENNORA NSW 2161
Office 8724 4600 | Direct 8724 4618 | Fax 8724 4604 | Mobile 0413 125 994
nbuckman@...<mailto:nbuckman@...> | www.gibsonshopfitters.com.au <http://www.gibsonshopfitters.com.au/>
From: vantage@yahoogroups.com [mailto:vantage@yahoogroups.com] On Behalf Of Brian Roberts
Sent: Wednesday, 28 November 2012 8:57 AM
To: vantage@yahoogroups.com
Subject: RE: [Vantage] Trying to read stock on hand ...
This bit in your code: pohwa.GetData("YNRA")
Should be a table name instead of your plant code. As a guess, try "PartWhse" or "PartBin".
Brian.
From: vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com> [mailto:vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com>] On Behalf Of nbuckman@...<mailto:nbuckman%40ymail.com>
Sent: Tuesday, November 27, 2012 6:09 AM
To: vantage@yahoogroups.com<mailto:vantage%40yahoogroups.com>
Subject: [Vantage] Trying to read stock on hand ...
Dear VB helpers,
Can anyone out there tell me where I am in the dark in the code below?
I just want to find out if there is stock on hand in the plant "YNRA".
This code falls over at the whadapterRow line, "Unable to find Table 0"
--------------------------------------------
Dim pohwa As PartOnHandWhseAdapter = New PartOnHandWhseAdapter(Me.oTrans)
pohwa.BOConnect()
Dim FoundWh As Boolean = pohwa.GetPartOnHandWhse(PartNum, "YNRA")
If FoundWh then
Try
Dim whds As System.Data.DataSet = pohwa.GetData("YNRA")
Dim whadapterRow As System.Data.DataRow = whds.Tables(0).Rows(0)
Dim QtyOh As Decimal = whadapterRow("OnHandQty")
EpiMessageBox.Show("On hand qty is " + QtyOH.toString())
Catch ex As System.Exception
ExceptionBox.Show(ex)
End Try
End If
---------------------------------------------
All suggestions welcome,
Thanks,
- Neil
[Non-text portions of this message have been removed]
Notice:This e-mail and any attachments are confidential and are only for the use of the person to whom they are addressed. If you are not the intended recipient please advise the sender by return e-mail and delete the message and any attachments. Any use, interference with, disclosure or copying of this message or any attachments is unauthorised and prohibited. The sender does not warrant that the information is free of a virus or any other defect or error, and any views expressed herein, unless specifically indicated otherwise, are those of the individual sender.
The DH Gibson Group of Companies - http://www.gibsonshopfitters.com.au
P Please consider our shared environment before printing this communication.
[Non-text portions of this message have been removed]