[]
将数据(最多二维)从数据源导入到范围。
[RequiresUnreferencedCode("This method uses reflection to construct generic types or get members. Read the user manual or contact support if it has AOT compatibility issues at runtime.")]
DataImportResult ImportData(IEnumerable items, DataImportOptions options = null)
| Type | Name | Description |
|---|---|---|
| IEnumerable | items | 要导入的项。元素类型可以是:
|
| DataImportOptions | options | 导入选项。 |
| Type | Description |
|---|---|
| DataImportResult |
如果项集合是基础类型的列表, 则方向由范围的形状确定。 如果范围的行数大于列数, 我们将集合垂直导入。 否则,我们将集合水平导入。
| Type | Condition |
|---|---|
| InvalidCastException | 某列的数据类型不一致。使用 ItemTypeProvider 来修复它。 |
| ArgumentException | 项的类型不受支持或 |
| NotSupportedException | 当运行时出现 AOT 兼容性问题,通常会抛出此异常。 |
将数据从数据源(最多二维)导入到范围。
[RequiresUnreferencedCode("This method uses reflection to construct generic types or get members. Read the user manual or contact support if it has AOT compatibility issues at runtime.")]
DataImportResult ImportData<T>(IEnumerable<T> items, DataImportOptions options = null)
| Type | Name | Description |
|---|---|---|
| IEnumerable<T> | items | 要导入的项目。元素类型可以是:
|
| DataImportOptions | options | 导入选项。 |
| Type | Description |
|---|---|
| DataImportResult |
| Name | Description |
|---|---|
| T |
如果项目集合是基础类型的列表, 则方向由范围的形状决定。 如果范围的行数大于列数, 我们将集合垂直导入。 否则,我们将集合水平导入。
| Type | Condition |
|---|---|
| InvalidCastException | 某列的数据类型不一致。检查 ItemTypeProvider 的实现是否正确。 |
| ArgumentException | 项目类型不受支持或 |
| NotSupportedException | 通常在运行时出现 AOT 兼容性问题时会抛出。 |
将数据从表格导入到范围。
[RequiresUnreferencedCode("This method uses reflection to construct generic types or get members. Read the user manual or contact support if it has AOT compatibility issues at runtime.")]
DataImportResult ImportData(DataTable table, DataImportOptions options = null)
| Type | Name | Description |
|---|---|---|
| DataTable | table | 要导入的表格。列类型可以是: |
| DataImportOptions | options | 导入选项。 |
| Type | Description |
|---|---|
| DataImportResult |
| Type | Condition |
|---|---|
| InvalidCastException | 列的数据类型不一致。 |
| ArgumentException |
|
| NotSupportedException | 通常在运行时发生 AOT 兼容性问题时会抛出此异常。 |