TableRequestInfo

Overview

TableRequestInfo allows you to specify additional parameters for querying certain schema tables.

With TableRequestInfo you can:

*specify custom parameters for getting data from parametrized schema tables. *specify if schema information is received inside the encoded schema table data. *specify the count of records you want to obtain.

Instances of the TableRequestInfo class are usually created on the client side and then passed into certain overloads of the DataAdapter.Fill method. Further TableRequestInfo will be serialized into GetData request that will be sent to the server.

You will quite often need to create and configure instances of the TableRequestInfo class to perform specific Fill requests.

There are several ways to create TableRequestInfo instances:
* using the NewTableRequestInfo method of the DataAbstractUtils class

TableRequestInfo reqInfo = 
  DataAbstractUtils.NewTableRequestInfo(
    "", 
    10, 
    true, 
    new string[1] { paramName }, 
    new object[1] { paramValue });

*or using the constructor:

TableRequestInfo reqInfo = new TableRequestInfo();
reqInfo.IncludeSchema = true;
reqInfo.MaxRecords = 10; 
DataParameter param = new DataParameter();
param.Name = paramName;
param.Value = paramValue;
reqInfo.Parameters = new DataParameter[1] { param };

The sample code below demonstrates how to obtain data from a parametrized schema table:

String lCustomerID = "ALFKI";
TableRequestInfo reqInfo =
              DataAbstractUtils.NewTableRequestInfo(
              "",    // User custom filter
              -1,    // Max records count (-1 means unlimited count)
              false, // Include schema or not
              new string[1] { "pCustomerID" }, // array of the parameter names
              new object[1] { lCustomerID }    // array of the parameter values
            );
remoteDataAdapter.Fill(myDataset, "Orders", reqInfo);
dataGridView.DataSource = myDataset.Tables["Orders"];

Location

 

constructor

 

constructor

 

TableRequestInfo()

 

Sub New

add_PropertyChanged    (declared in ComplexType)

 

method add_PropertyChanged(value: PropertyChangedEventHandler)

 

void add_PropertyChanged(PropertyChangedEventHandler value)

 

Sub add_PropertyChanged(value As PropertyChangedEventHandler)

Parameters:

  • value:

GetAttributeCount    (declared in ComplexType)

 

method GetAttributeCount: Int32

 

Int32 GetAttributeCount()

 

Function GetAttributeCount As Int32

GetAttributeName    (declared in ComplexType)

 

method GetAttributeName(index: Int32): String

 

String GetAttributeName(Int32 index)

 

Function GetAttributeName(index As Int32) As String

Parameters:

  • index:

GetAttributeValue    (declared in ComplexType)

 

method GetAttributeValue(index: Int32): String

 

String GetAttributeValue(Int32 index)

 

Function GetAttributeValue(index As Int32) As String

Parameters:

  • index:

IncludeSchema

Boolean property that specifies if table schema info s needed inside the result stream (true) or not (false, default). Usually, the client side already knows the schema, so passing the schema with the table data will cause some overhead, but if you need to update table schema info on the client side, you need to set that property to true.

For example, you can create a new DataTable and try to fill it with data from a specified table. Since the structure for the new DataTable is not defined yet, you can establish to put the schema info with the table data, thus giving the data table a proper structure before it will be filled.

 

property IncludeSchema: Boolean read write;

 

Boolean IncludeSchema { get; set; }

 

Property IncludeSchema As Boolean

MaxRecords

This property allows to limit the count of rows of the request. Put it as -1 to receive all available records. 0 value will update the table schema without receiving any data.

Limiting the amount of transferred rows can reduce traffic between the DataAbstract server (middle tier) and the DataAbstract client (front-end tier). It will not affect traffic between the database and the DataAbstract server. For reducing traffic between the database and the DataAbstract server, you have to use other approaches, like Dynamic Where.

 

property MaxRecords: Int32 read write;

 

Int32 MaxRecords { get; set; }

 

Property MaxRecords As Int32

Parameters

Represents the array of the DataParameters for getting data from parametrized schema tables.

 

property Parameters: array of DataParameter read write;

 

DataParameter[] Parameters { get; set; }

 

Property Parameters As array of DataParameter

PropertyChanged    (declared in ComplexType)

 

event PropertyChanged: PropertyChangedEventHandler;

 

delegate PropertyChangedEventHandler PropertyChanged()

 

Event PropertyChanged As PropertyChangedEventHandler

ReadComplex

 

method ReadComplex(aSerializer: Serializer)

 

void ReadComplex(Serializer aSerializer)

 

Sub ReadComplex(aSerializer As Serializer)

Parameters:

  • aSerializer:

remove_PropertyChanged    (declared in ComplexType)

 

method remove_PropertyChanged(value: PropertyChangedEventHandler)

 

void remove_PropertyChanged(PropertyChangedEventHandler value)

 

Sub remove_PropertyChanged(value As PropertyChangedEventHandler)

Parameters:

  • value:

TriggerPropertyChanged  protected    (declared in ComplexType)

 

method TriggerPropertyChanged(propertyName: String)

 

void TriggerPropertyChanged(String propertyName)

 

Sub TriggerPropertyChanged(propertyName As String)

Parameters:

  • propertyName:

UserFilter

Uses for specifying custom conditions for returning rows. For example, "CustomerType < 100". Note that all records will be read from the database, but only those that fit the custom condition will be passed to the client.

Note: Applying custom filters is not supported by DataAbstract for .NET, you need to use the more advanced feature Dynamic Where there.

 

property UserFilter: String read write;

 

String UserFilter { get; set; }

 

Property UserFilter As String

WriteComplex

 

method WriteComplex(aSerializer: Serializer)

 

void WriteComplex(Serializer aSerializer)

 

Sub WriteComplex(aSerializer As Serializer)

Parameters:

  • aSerializer:

 

IncludeSchema

Boolean property that specifies if table schema info s needed inside the result stream (true) or not (false, default). Usually, the client side already knows the schema, so passing the schema with the table data will cause some overhead, but if you need to update table schema info on the client side, you need to set that property to true.

For example, you can create a new DataTable and try to fill it with data from a specified table. Since the structure for the new DataTable is not defined yet, you can establish to put the schema info with the table data, thus giving the data table a proper structure before it will be filled.

 

property IncludeSchema: Boolean read write;

 

Boolean IncludeSchema { get; set; }

 

Property IncludeSchema As Boolean

MaxRecords

This property allows to limit the count of rows of the request. Put it as -1 to receive all available records. 0 value will update the table schema without receiving any data.

Limiting the amount of transferred rows can reduce traffic between the DataAbstract server (middle tier) and the DataAbstract client (front-end tier). It will not affect traffic between the database and the DataAbstract server. For reducing traffic between the database and the DataAbstract server, you have to use other approaches, like Dynamic Where.

 

property MaxRecords: Int32 read write;

 

Int32 MaxRecords { get; set; }

 

Property MaxRecords As Int32

Parameters

Represents the array of the DataParameters for getting data from parametrized schema tables.

 

property Parameters: array of DataParameter read write;

 

DataParameter[] Parameters { get; set; }

 

Property Parameters As array of DataParameter

UserFilter

Uses for specifying custom conditions for returning rows. For example, "CustomerType < 100". Note that all records will be read from the database, but only those that fit the custom condition will be passed to the client.

Note: Applying custom filters is not supported by DataAbstract for .NET, you need to use the more advanced feature Dynamic Where there.

 

property UserFilter: String read write;

 

String UserFilter { get; set; }

 

Property UserFilter As String

 

constructor

 

constructor

 

TableRequestInfo()

 

Sub New

add_PropertyChanged    (declared in ComplexType)

 

method add_PropertyChanged(value: PropertyChangedEventHandler)

 

void add_PropertyChanged(PropertyChangedEventHandler value)

 

Sub add_PropertyChanged(value As PropertyChangedEventHandler)

Parameters:

  • value:

GetAttributeCount    (declared in ComplexType)

 

method GetAttributeCount: Int32

 

Int32 GetAttributeCount()

 

Function GetAttributeCount As Int32

GetAttributeName    (declared in ComplexType)

 

method GetAttributeName(index: Int32): String

 

String GetAttributeName(Int32 index)

 

Function GetAttributeName(index As Int32) As String

Parameters:

  • index:

GetAttributeValue    (declared in ComplexType)

 

method GetAttributeValue(index: Int32): String

 

String GetAttributeValue(Int32 index)

 

Function GetAttributeValue(index As Int32) As String

Parameters:

  • index:

ReadComplex

 

method ReadComplex(aSerializer: Serializer)

 

void ReadComplex(Serializer aSerializer)

 

Sub ReadComplex(aSerializer As Serializer)

Parameters:

  • aSerializer:

remove_PropertyChanged    (declared in ComplexType)

 

method remove_PropertyChanged(value: PropertyChangedEventHandler)

 

void remove_PropertyChanged(PropertyChangedEventHandler value)

 

Sub remove_PropertyChanged(value As PropertyChangedEventHandler)

Parameters:

  • value:

TriggerPropertyChanged  protected    (declared in ComplexType)

 

method TriggerPropertyChanged(propertyName: String)

 

void TriggerPropertyChanged(String propertyName)

 

Sub TriggerPropertyChanged(propertyName As String)

Parameters:

  • propertyName:

WriteComplex

 

method WriteComplex(aSerializer: Serializer)

 

void WriteComplex(Serializer aSerializer)

 

Sub WriteComplex(aSerializer As Serializer)

Parameters:

  • aSerializer:

 

PropertyChanged    (declared in ComplexType)

 

event PropertyChanged: PropertyChangedEventHandler;

 

delegate PropertyChangedEventHandler PropertyChanged()

 

Event PropertyChanged As PropertyChangedEventHandler

Descendants

See Also

  • TableRequestInfo Class: