Hi,
I'm working in Visual Studio .NET 2003 with NetCOBOL V 1.1 and C#. I have found out a problem to Pass a DataSet from C# to Cobol. In my cobol program I don't receve data.
Moreover I don't succeed to read a DataSet in Cobol, and move every record in a Cobol structure. Did you help me?
Did you have some examples?
Thanks
Daniela
My program:
IDENTIFICATION DIVISION.
CLASS-ID. CBDataSet AS "CobolDataSet.CBDataSet".
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SPECIAL-NAMES.
REPOSITORY.
CLASS CLASS-DATASET AS "System.Data.DataSet"
CLASS CLASS-DATAROW AS "System.Data.DataRow"
CLASS CLASS-DATAROWS AS "System.Data.DataRow[]"
CLASS CLASS-DATACOLUMN AS "System.Data.DataColumn"
CLASS CLASS-DATATABLE AS "System.Data.DataTable"
CLASS CLASS-DATARELATION AS "System.Data.DataRelation"
PROPERTY PROP-TABLES AS "Tables". STATIC.
DATA DIVISION.
WORKING-STORAGE SECTION.
PROCEDURE DIVISION.
END STATIC.
OBJECT.
DATA DIVISION.
WORKING-STORAGE SECTION.
*******************************
* Tabella sedi INPS
*************************
01 REC-TABSEDI.
05 SEI-CODSEDINPS PIC S9(04) COMP-3.
05 SEI-DESCRIZ PIC X(025).
05 SEI-VIA PIC X(040).
05 SEI-NUMERO PIC X(005).
05 SEI-CAP PIC X(005).
05 SEI-COMUNE PIC X(025).
05 SEI-PROVINC PIC X(002).
05 SEI-TELEFONO PIC X(015).
01 IND PIC 9(4).
PROCEDURE DIVISION.
METHOD-ID. ScomponiDataSet.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 MySQLDataTable OBJECT REFERENCE CLASS-DATATABLE.
01 MyDataRow OBJECT REFERENCE CLASS-DATAROW.
01 MyDataRows OBJECT REFERENCE CLASS-DATAROWS.
01 MyDataRelation OBJECT REFERENCE CLASS-DATARELATION.
LINKAGE SECTION.
01 MySQLDataSet OBJECT REFERENCE CLASS-DATASET.
PROCEDURE DIVISION USING MySQLDataSet.
INVOKE PROP-TABLES of MySqlDataSet "get_Item"
USING BY VALUE 0 RETURNING MySQLDataTable.
INVOKE MySQLDataTable "NewRow" RETURNING MyDataRow.
INVOKE MyDataRow "GetChildRows"
USING BY VALUE MyDataRelation
RETURNING MyDataRows.
END METHOD ScomponiDataSet.
END OBJECT.
END CLASS CBDataSet.
I'm working in Visual Studio .NET 2003 with NetCOBOL V 1.1 and C#. I have found out a problem to Pass a DataSet from C# to Cobol. In my cobol program I don't receve data.
Moreover I don't succeed to read a DataSet in Cobol, and move every record in a Cobol structure. Did you help me?
Did you have some examples?
Thanks
Daniela
My program:
IDENTIFICATION DIVISION.
CLASS-ID. CBDataSet AS "CobolDataSet.CBDataSet".
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SPECIAL-NAMES.
REPOSITORY.
CLASS CLASS-DATASET AS "System.Data.DataSet"
CLASS CLASS-DATAROW AS "System.Data.DataRow"
CLASS CLASS-DATAROWS AS "System.Data.DataRow[]"
CLASS CLASS-DATACOLUMN AS "System.Data.DataColumn"
CLASS CLASS-DATATABLE AS "System.Data.DataTable"
CLASS CLASS-DATARELATION AS "System.Data.DataRelation"
PROPERTY PROP-TABLES AS "Tables". STATIC.
DATA DIVISION.
WORKING-STORAGE SECTION.
PROCEDURE DIVISION.
END STATIC.
OBJECT.
DATA DIVISION.
WORKING-STORAGE SECTION.
*******************************
* Tabella sedi INPS
*************************
01 REC-TABSEDI.
05 SEI-CODSEDINPS PIC S9(04) COMP-3.
05 SEI-DESCRIZ PIC X(025).
05 SEI-VIA PIC X(040).
05 SEI-NUMERO PIC X(005).
05 SEI-CAP PIC X(005).
05 SEI-COMUNE PIC X(025).
05 SEI-PROVINC PIC X(002).
05 SEI-TELEFONO PIC X(015).
01 IND PIC 9(4).
PROCEDURE DIVISION.
METHOD-ID. ScomponiDataSet.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 MySQLDataTable OBJECT REFERENCE CLASS-DATATABLE.
01 MyDataRow OBJECT REFERENCE CLASS-DATAROW.
01 MyDataRows OBJECT REFERENCE CLASS-DATAROWS.
01 MyDataRelation OBJECT REFERENCE CLASS-DATARELATION.
LINKAGE SECTION.
01 MySQLDataSet OBJECT REFERENCE CLASS-DATASET.
PROCEDURE DIVISION USING MySQLDataSet.
INVOKE PROP-TABLES of MySqlDataSet "get_Item"
USING BY VALUE 0 RETURNING MySQLDataTable.
INVOKE MySQLDataTable "NewRow" RETURNING MyDataRow.
INVOKE MyDataRow "GetChildRows"
USING BY VALUE MyDataRelation
RETURNING MyDataRows.
END METHOD ScomponiDataSet.
END OBJECT.
END CLASS CBDataSet.