Fill (Fill the DataSet from FILE/VIEW)

Top 

 

Fill(DataSet dataSet, SchemaType schemaType);

 

The Fill method fills the target Dataset with data from the FILE or VIEW. The Constructor determines which structure will be used. The schemaType parameter always defaults to a SchemaType.Mapped value. In all cases a new table with new columns is created. The name of the newly created table by default is Table if no Table Mapping information is specified with the TableMappings property, or the name specified in the corresponding Table Mapping (DataTableMapping class). Only columns of the VIEW’s primary FILE are editable. All other columns are marked as ReadOnly.

 

The following data type mapping is used when filling the DataSet:

 

Clarion .NET Type

DataSet’s .NET type

PSTRING, CSTRING, CLASTRING

System.String

BOOL, USHORT, SHORT,SIGNED, UNSIGNED, SREAL, BFLOAT4, REAL, BFLOAT8

The underlying .Net type that is used in Clarion .NET to represent the specified type

PDECIMAL, CLADECIMAL

System.Decimal

 

Conceptual Examples:

 

!Fill the dataSet with data from the FILE/VIEW structure

!Returns an integer representing the number of read rows

Fill(DataSet dataSet)

 

!Fill the dataSet with data from the FILE/VIEW structure

!but the maximum number of rows read is equal to nRowCount

Fill(DataSet dataSet,int nRowCount)

 

 

Programming Notes:

1.

You must open the corresponding FILE/VIEW structure before using the Fill method.

2.

The method reads the FILE/VIEW with a NEXT statement from the current position. You can change initial position using the SET function. After filling the dataset the position in the FILE/VIEW is restored.

3.

If the filled table is already present in the DataSet, it is automatically cleared before filling.