How to retrieve a cell value from a dataset

I am trying to use Visual COBOL for Visual Studio to call a SOAP webservices method to return multiple attribution of an item. The webservices method takes in a string value (item number), and returns a dataset (dsItemDetails). It is a very simple dataset, only one table in the dataset, and only one row in the return table, two columns in the return row, they are (item number), and (item description).

My questions is: how can I move the item description value in the return row to a string variable (strLableName) in Visual COBOL?

I knew the webservices call worked, I checked the row count in the returned dataset - datatable. It had a value of 1.

The other problem I had was I could not get the DataSet Visualizer to work in debug. Was it suppose to work in Visual COBOL for Visual Studio? It always work when I coded in Visual Basic with my Visual Studio settings.

Below are the codes from my test program:

01 wsinquiry type WSName.RXORDWS004 value new type WSName.RXORDWS004.
01 inItemNbr pic x(11).
01 any-key pic x.
01 intRowCount pic 999.
01 dsItemDetails type System.Data.DataSet.
01 strLableName type String.

procedure division.

set inItemNbr to "00002062402"

* returns a dataset
set dsItemDetails to wsinquiry::GetNDCAttributes(inItemNbr) as type System.Data.DataSet

* check for row count in the returned dataset - datatable
set intRowCount to dsItemDetails::Tables::Count

* This is how I coded in Visual Basic to get the ITEM_DESC value to a string variable

* strLableName = CStr(dsItemDetails.Tables(0).Rows(0).Item(1))

* OR strLableName = CStr(dsItemDetails.Tables(0).Rows(0).Item("ITEM_DESC"))

* How to code in Visual COBOL to perform the same function?

display " "
goback.

end program TestWSLink.

Many thanks from Stan

Parents Reply Children