|
Programmer's Reference >
ExcelApplication API >
Area > ImportData
ImportData Method
Signature:
public Area ImportData ( System.Data.IDataReader data
, DataImportProperties props
)
Description:
Imports data from an IDataReader to the specified Area . The new data will overwrite values and formulas in the target worksheet cells, but existing formatting will be preserved.
Parameters:
|
data |
An instance of System.Data.SqlClient.SqlDataReader or System.Data.OleDb.OleDbDataReader . |
|
props |
A DataImportProperties object that contains a set of properties that will determine the behavior of the data import. |
Returns:
Area
An Area object representing the set of cells populated with the imported values.
Examples:
[csharp]
DataImportProperties importProps = wb.CreateDataImportProperties();
importProps.Truncate = true;
Area importedArea = a.ImportData(dr, importProps);
[vbnet]
Dim importProps As DataImportProperties = wb.CreateDataImportProperties();
importProps.Truncate = True
Dim importedArea As Area = a.ImportData(dr, importProps)
Copyright 2005 © SoftArtisans, Inc. All Rights Reserved.
|
|
|