ImportData
内容
[
隐藏
]ImportData(IDataReader, int, int)
从IDataReader对象.
public int ImportData(IDataReader reader, int firstRow, int firstColumn)
范围 | 类型 | 描述 |
---|---|---|
reader | IDataReader | 这IDataReader包含数据的对象。 |
firstRow | Int32 | 要导入的第一个单元格的行号。 |
firstColumn | Int32 | 要导入的第一个单元格的列号。 |
返回值
导入的总行数。
也可以看看
- class Cells
- 命名空间 Aspose.Cells
- 部件 Aspose.Cells
ImportData(IDataReader, int, int, ImportTableOptions)
从IDataReader对象.
public int ImportData(IDataReader reader, int firstRow, int firstColumn, ImportTableOptions options)
范围 | 类型 | 描述 |
---|---|---|
reader | IDataReader | 这IDataReader包含数据的对象。 |
firstRow | Int32 | 要导入的第一个单元格的行号。 |
firstColumn | Int32 | 要导入的第一个单元格的列号。 |
options | ImportTableOptions | 导入表的选项。 |
返回值
导入的总行数。
也可以看看
- class ImportTableOptions
- class Cells
- 命名空间 Aspose.Cells
- 部件 Aspose.Cells
ImportData(ICellsDataTable, int, int, ImportTableOptions)
从自定义数据表中导入数据。
public int ImportData(ICellsDataTable table, int firstRow, int firstColumn,
ImportTableOptions options)
范围 | 类型 | 描述 |
---|---|---|
table | ICellsDataTable | 自定义数据表。 |
firstRow | Int32 | 第一行索引。 |
firstColumn | Int32 | 第一列索引。 |
options | ImportTableOptions | 导入选项 |
也可以看看
- interface ICellsDataTable
- class ImportTableOptions
- class Cells
- 命名空间 Aspose.Cells
- 部件 Aspose.Cells
ImportData(DataTable, int, int, ImportTableOptions)
从自定义数据表中导入数据。
public int ImportData(DataTable table, int firstRow, int firstColumn, ImportTableOptions options)
范围 | 类型 | 描述 |
---|---|---|
table | DataTable | 这DataTable要导入的对象。 |
firstRow | Int32 | 第一行索引。 |
firstColumn | Int32 | 第一列索引。 |
options | ImportTableOptions | 导入选项 |
返回值
导入的总行数。
例子
[C#]
Workbook excel = new Workbook();
Cells cells = excel.Worksheets[0].Cells;
//导入数据
DataTable dt = new DataTable("Products");
dt.Columns.Add("Product_ID",typeof(Int32));
dt.Columns.Add("Product_Name",typeof(string));
dt.Columns.Add("Units_In_Stock",typeof(Int32));
DataRow dr = dt.NewRow();
dr[0] = 1;
dr[1] = "Aniseed Syrup";
dr[2] = 15;
dt.Rows.Add(dr);
dr = dt.NewRow();
dr[0] = 2;
dr[1] = "Boston Crab Meat";
dr[2] = 123;
dt.Rows.Add(dr);
ImportTableOptions options = new ImportTableOptions();
options.IsFieldNameShown = true;
cells.ImportData(dt, 12, 12, options);
[Visual Basic]
Dim excel as Workbook = new Workbook()
Dim cells as Cells = excel.Worksheets(0).Cells
'导入数据
Dim dt as DataTable = new DataTable("Employee")
dt.Columns.Add("Employee_ID",typeof(Int32))
dt.Columns.Add("Employee_Name",typeof(string))
dt.Columns.Add("Gender",typeof(string))
Dim dr as DataRow = dt.NewRow()
dr(0) = 1
dr(1) = "John Smith"
dr(2) = "Male"
dt.Rows.Add(dr)
dr = dt.NewRow()
dr(0) = 2
dr(1) = "Mary Miller"
dr(2) = "Female"
dt.Rows.Add(dr)
Dim options as ImportTableOptions = new ImportTableOptions()
options.IsFieldNameShown = True
cells.ImportData(dt, 12, 12, options)
'导出数据
Dim outDataTable as DataTable = cells.ExportDataTable(12, 12, 10, 10)
也可以看看
- class ImportTableOptions
- class Cells
- 命名空间 Aspose.Cells
- 部件 Aspose.Cells
ImportData(DataView, int, int, ImportTableOptions)
从数据视图导入数据。
public int ImportData(DataView dataView, int firstRow, int firstColumn, ImportTableOptions options)
范围 | 类型 | 描述 |
---|---|---|
dataView | DataView | 这DataView要导入的对象。 |
firstRow | Int32 | 第一行索引。 |
firstColumn | Int32 | 第一列索引。 |
options | ImportTableOptions | 导入选项 |
返回值
导入的总行数。
也可以看看
- class ImportTableOptions
- class Cells
- 命名空间 Aspose.Cells
- 部件 Aspose.Cells