Partilhar via


IRuntimeHelper.CreateDataTable Method (IEntityInstanceEnumerator, Int32, Boolean)

Creates a DataTable with the data obtained from the given enumeration of External Items with a specified maximum number of rows and an option to create an extra column to store identities of the External Items.

Namespace:  Microsoft.BusinessData.Runtime
Assembly:  Microsoft.BusinessData (in Microsoft.BusinessData.dll)

Syntax

'Declaration
Function CreateDataTable ( _
    dataSource As IEntityInstanceEnumerator, _
    rowCount As Integer, _
    createSerializedIdColumn As Boolean _
) As DataTable
'Usage
Dim instance As IRuntimeHelper
Dim dataSource As IEntityInstanceEnumerator
Dim rowCount As Integer
Dim createSerializedIdColumn As Boolean
Dim returnValue As DataTable

returnValue = instance.CreateDataTable(dataSource, _
    rowCount, createSerializedIdColumn)
DataTable CreateDataTable(
    IEntityInstanceEnumerator dataSource,
    int rowCount,
    bool createSerializedIdColumn
)

Parameters

  • createSerializedIdColumn
    Type: System.Boolean

    true to create an additional column with the serialized identifier values of the External Items; otherwise, false.

Return Value

Type: System.Data.DataTable
A DataTable that is populated with the data.

Remarks

This method will close the enumerator even if all the items are not read from the enumerator. The name of the column which contains identifier values will be “BdcIdentity”.

Instances of objects in the Business Data Connectivity object model are tied to the Metadata Store they are obtained from. Using instances tied to one Metadata Store with the instances from another Metadata Store will cause data corruption and other unexpected behavior. For more information, see DatabaseBackedMetadataCatalog, FileBackedMetadataCatalog, and RemoteSharedFileBackedMetadataCatalog.

See Also

Reference

IRuntimeHelper Interface

IRuntimeHelper Members

CreateDataTable Overload

Microsoft.BusinessData.Runtime Namespace