ImportCustomObjects

ImportCustomObjects(ICollection, string[], bool, int, int, int, bool, string, bool)

导入自定义对象。

public int ImportCustomObjects(ICollection list, string[] propertyNames, bool isPropertyNameShown, 
    int firstRow, int firstColumn, int rowNumber, bool insertRows, string dateFormatString, 
    bool convertStringToNumber)
范围类型描述
listICollection自定义对象
propertyNamesString[]属性名称。如果为空,我们将导入对象的所有属性。
isPropertyNameShownBoolean表示是否将属性名称导入第一行。
firstRowInt32要导入的第一个单元格的行号。
firstColumnInt32要导入的第一个单元格的列号。
rowNumberInt32要导入的行数。
insertRowsBoolean指示是否添加额外的行以适应数据。
dateFormatStringString单元格的日期格式字符串。
convertStringToNumberBoolean指示此方法是否会尝试将字符串转换为数字。

返回值

导入的总行数。

评论

自定义对象应该是相同的类型。

也可以看看


ImportCustomObjects(ICollection, int, int, ImportTableOptions)

导入自定义对象。

public int ImportCustomObjects(ICollection list, int firstRow, int firstColumn, 
    ImportTableOptions options)
范围类型描述
listICollection自定义对象
firstRowInt32要导入的第一个单元格的行号。
firstColumnInt32要导入的第一个单元格的列号。
optionsImportTableOptions导入选项。

返回值

导入的总行数。

评论

自定义对象应该是相同的类型。

也可以看看