Export (0) Print
Expand All

DbDataAdapter.Fill Method

Adds or refreshes rows in the DataSet to match those in the data source.

Overload List

Adds or refreshes rows in the DataSet to match those in the data source using the DataSet name, and creates a DataTable named "Table".

Supported by the .NET Compact Framework.

[Visual Basic] Overloads Overrides Public Function Fill(DataSet) As Integer Implements IDataAdapter.Fill
[C#] public override int Fill(DataSet);
[C++] public: int Fill(DataSet*);
[JScript] public override function Fill(DataSet) : int;

Adds or refreshes rows in a DataTable to match those in the data source using the DataTable name.

Supported by the .NET Compact Framework.

[Visual Basic] Overloads Public Function Fill(DataTable) As Integer
[C#] public int Fill(DataTable);
[C++] public: int Fill(DataTable*);
[JScript] public function Fill(DataTable) : int;

Adds or refreshes rows in the DataSet to match those in the data source using the DataSet and DataTable names.

Supported by the .NET Compact Framework.

[Visual Basic] Overloads Public Function Fill(DataSet, String) As Integer
[C#] public int Fill(DataSet, string);
[C++] public: int Fill(DataSet*, String*);
[JScript] public function Fill(DataSet, String) : int;

Adds or refreshes rows in a DataTable to match those in the data source using the specified DataTable and IDataReader names.

Supported by the .NET Compact Framework.

[Visual Basic] Overloads Protected Overridable Function Fill(DataTable, IDataReader) As Integer
[C#] protected virtual int Fill(DataTable, IDataReader);
[C++] protected: virtual int Fill(DataTable*, IDataReader*);
[JScript] protected function Fill(DataTable, IDataReader) : int;

Adds or refreshes rows in a DataTable to match those in the data source using the DataTable name, the specified SQL SELECT statement, and CommandBehavior.

Supported by the .NET Compact Framework.

[Visual Basic] Overloads Protected Overridable Function Fill(DataTable, IDbCommand, CommandBehavior) As Integer
[C#] protected virtual int Fill(DataTable, IDbCommand, CommandBehavior);
[C++] protected: virtual int Fill(DataTable*, IDbCommand*, CommandBehavior);
[JScript] protected function Fill(DataTable, IDbCommand, CommandBehavior) : int;

Adds or refreshes rows in a specified range in the DataSet to match those in the data source using the DataSet and DataTable names.

Supported by the .NET Compact Framework.

[Visual Basic] Overloads Public Function Fill(DataSet, Integer, Integer, String) As Integer
[C#] public int Fill(DataSet, int, int, string);
[C++] public: int Fill(DataSet*, int, int, String*);
[JScript] public function Fill(DataSet, int, int, String) : int;

Adds or refreshes rows in a specified range in the DataSet to match those in the data source using the DataSet, DataTable, and IDataReader names.

Supported by the .NET Compact Framework.

[Visual Basic] Overloads Protected Overridable Function Fill(DataSet, String, IDataReader, Integer, Integer) As Integer
[C#] protected virtual int Fill(DataSet, string, IDataReader, int, int);
[C++] protected: virtual int Fill(DataSet*, String*, IDataReader*, int, int);
[JScript] protected function Fill(DataSet, String, IDataReader, int, int) : int;

Adds or refreshes rows in a specified range in the DataSet to match those in the data source using the DataSet and source table names, command string, and command behavior.

Supported by the .NET Compact Framework.

[Visual Basic] Overloads Protected Overridable Function Fill(DataSet, Integer, Integer, String, IDbCommand, CommandBehavior) As Integer
[C#] protected virtual int Fill(DataSet, int, int, string, IDbCommand, CommandBehavior);
[C++] protected: virtual int Fill(DataSet*, int, int, String*, IDbCommand*, CommandBehavior);
[JScript] protected function Fill(DataSet, int, int, String, IDbCommand, CommandBehavior) : int;

Example

[Visual Basic, C#, C++] The following example uses the derived class, OleDbDataAdapter, to fill a DataSet with 15 rows, beginning at row 10, from the categories table. This example assumes that you have created an OleDbDataAdapter and a DataSet.

[Visual Basic, C#, C++] Note   This example shows how to use one of the overloaded versions of Fill. For other examples that might be available, see the individual overload topics.
[Visual Basic] 
Public Sub GetMyRecords()
    ' ...
    ' create myDataSet and myDataAdapter
    ' ...
    myDataAdapter.Fill(myDataSet, 9, 15, "Categories")
End Sub

[C#] 
public void GetMyRecords() {
   // ...
   // create myDataSet and myDataAdapter
   // ...
   myDataAdapter.Fill(myDataSet,9,15,"Categories");
}

[C++] 
void GetMyRecords() {
   // ...
   // create myDataSet and myDataAdapter
   // ...
   myDataAdapter->Fill(myDataSet,9,15,S"Categories");
}

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.

See Also

DbDataAdapter Class | DbDataAdapter Members | System.Data.Common Namespace

Show:
© 2014 Microsoft