Szerkesztés

Megosztás a következőn keresztül:


DesignTimeData.CreateSampleDataTable Method

Definition

Creates a DataTable object with the same schema as the provided data.

Overloads

CreateSampleDataTable(IEnumerable)

Creates a sample DataTable object with the same schema as the provided data.

CreateSampleDataTable(IEnumerable, Boolean)

Creates a DataTable object with the same schema as the provided data and optionally containing column names indicating that the data is bound data.

CreateSampleDataTable(IEnumerable)

Creates a sample DataTable object with the same schema as the provided data.

public:
 static System::Data::DataTable ^ CreateSampleDataTable(System::Collections::IEnumerable ^ referenceData);
public static System.Data.DataTable CreateSampleDataTable (System.Collections.IEnumerable referenceData);
static member CreateSampleDataTable : System.Collections.IEnumerable -> System.Data.DataTable
Public Shared Function CreateSampleDataTable (referenceData As IEnumerable) As DataTable

Parameters

referenceData
IEnumerable

A data source with the desired schema to use as the format for the sample DataTable object.

Returns

A DataTable object that contains columns with the same names and data types as the provided referenceData.

Remarks

The data types that can be created are the primitive types, such as number, string, and date types. Any other types are replaced by columns of type String. The calling designer component can call the GetDesignTimeDataSource method to add rows of data to the resulting table.

See also

Applies to

CreateSampleDataTable(IEnumerable, Boolean)

Creates a DataTable object with the same schema as the provided data and optionally containing column names indicating that the data is bound data.

public:
 static System::Data::DataTable ^ CreateSampleDataTable(System::Collections::IEnumerable ^ referenceData, bool useDataBoundData);
public static System.Data.DataTable CreateSampleDataTable (System.Collections.IEnumerable referenceData, bool useDataBoundData);
static member CreateSampleDataTable : System.Collections.IEnumerable * bool -> System.Data.DataTable
Public Shared Function CreateSampleDataTable (referenceData As IEnumerable, useDataBoundData As Boolean) As DataTable

Parameters

referenceData
IEnumerable

An IEnumerable object containing data.

useDataBoundData
Boolean

If true, the column names indicate that they contain bound data.

Returns

A DataTable object.

Remarks

The data types that can be created are the primitive types, such as number, string, and date types. Any other types are replaced by columns of type String. The calling designer component can use GetDesignTimeDataSource to add rows of data to the resulting table.

See also

Applies to