NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

DBDataSetCommand.FillDataSet (DataSet, String, Int32, Int32)

Fills the data set with records from between the given bounds and schema from a given source table.

[Visual Basic]
Overloads Overridable Public Function FillDataSet( _
   ByVal dataSet As DataSet, _
   ByVal srcTable As String, _
   ByVal startRecord As Integer, _
   ByVal maxRecords As Integer _
) As Integer
[C#]
public virtual int FillDataSet(
   DataSet dataSet,
   string srcTable,
   int startRecord,
   int maxRecords
);
[C++]
public: virtual int FillDataSet(
   DataSet* dataSet,
   String* srcTable,
   int startRecord,
   int maxRecords
);
[JScript]
public function FillDataSet(
   dataSet : DataSet,
   srcTable : String,
   startRecord : int,
   maxRecords : int
) : int;

Parameters

dataSet
A DataSet to fill with records.
srcTable
The name of the source table used for the table mappings.
startRecord
The zero-based record number to start on.
maxRecords
The maximum number of records to retrieve.

Exceptions

Exception Type Condition
FillDataSetRequiresDataSet The DataSet was invalid.
FillDataSetRequiresSourceTable The source table was invalid.
NotAnAdapterCommand The ADOConnection could not be found.
InvalidStartRecord The startRecord parameter was less than 0.
InvalidMaxRecords The maxRecords parameter was a value less than 0.
FillDataSetRequiresConnection The ADOConnection was invalid.

Remarks

A maxRecords value of 0 gets all records found after the start record.

Notes to Inheritors: When overriding FillDataSet in a derived class, be sure to call the base class's FillDataSet method.

Example [Visual Basic]

The following example fills a previously created DataSet with the schema and only records 10 through 20 provided the source table exists.

[Visual Basic]

Function MyTwixtTenAndTwenty(myDataSet As DataSet, srcTable As String) As DataSet
    ' fill the data set
    FillDataSet myDataSet, srcTable, 10, 20
    ' return the data set (or will this only return the schema?)
    MyFillData = myDataSet.Clone
End Function

See Also

DBDataSetCommand Class | DBDataSetCommand Members | System.Data.Internal Namespace | DBDataSetCommand.FillDataSet Overload List