NativeExcel for .Net Developer's Reference

IRange.SetDataTable Method 

Copies the specified DataTable into this range.

[Visual Basic]
Function SetDataTable( _ 
   ByVal table As DataTable, _ 
   ByVal ColHeaders As Boolean _ 
) As Integer
[C#]
int SetDataTable(
   DataTable table,
   bool ColHeaders
);
[C++]
int SetDataTable(
   DataTable* table,
   bool ColHeaders
);
[JScript]
function SetDataTable(
   DataTable table,
   bool ColHeaders
): int;

Parameters

table
Specifies the source DataTable.
ColHeaders
True to specify that a row with column headers will be created from the DataTable's column names.

Return Value

Returns the number of copied rows.

Example

See Also

IRange Interface | NativeExcel Namespace | GetDataTable Method