FetchAll Property (DbDataTable)
In This Topic
Determines whether data is requested from server entirely or partially.
Syntax
|
|---|
'Declaration
Public Overridable Property FetchAll As Boolean |
|
|---|
public virtual bool FetchAll {get; set;} |
Property Value
If
true, the data is requested when the
DbDataTable is opened, otherwise records are fetched only when necessary.
Example
The following example demonstrates how to use the
FetchAll property.
|
|---|
static void UseDataTable(DbDataTable myDataTable, DbConnection myConnection, DataGrid dataGrid) {
myDataTable.Connection = myConnection;
myDataTable.SelectCommand = myConnection.CreateCommand();
myDataTable.SelectCommand.CommandText = "SELECT * FROM Test.Dept";
myDataTable.FetchAll = true;
myDataTable.CachedUpdates = false;
myDataTable.Active = true;
dataGrid.DataSource = myDataTable;
} |
|
|---|
Private Shared Sub UseDataTable(ByVal myDataTable As DbDataTable, ByVal myConnection As DbConnection, ByVal dataGrid As DataGrid)
myDataTable.Connection = myConnection
myDataTable.SelectCommand = myConnection.CreateCommand
myDataTable.SelectCommand.CommandText = "SELECT * FROM Test.Dept"
myDataTable.FetchAll = True
myDataTable.CachedUpdates = False
myDataTable.Active = True
dataGrid.DataSource = myDataTable
End Sub |
See Also