SpreadsheetGear 读取批量 excel 文件
SpreadhsheetGear to read bulk excel file
我想使用 SpreadhsheetGear
读取大量 excel 文件
public ValueFormulaSet ReadData(string sheetName, string address)
{
var wrksh = this.Workbook.Worksheets[sheetName];
var range = wrksh.Range[address];
var result = new ValueFormulaSet();
result.RowCount = range.RowCount;
result.Values = (object[,])range.Value;
result.Formulas = (object[,])GetFormulas(range);
return result;
}
我想知道这种方法会读取整个数据并将其填充到 result.Values
由于我想使用批量数据文件,这种方法可能会占用大量内存。
有没有其他方法可以改进内存优化方法?
我不知道 SpreadhsheetGear 如何处理批量文件。
我正在寻找一些延迟加载方法,通过它我可以做一些缓冲,
或者我想做一些像实现 IDataReader
和使用 SqlBulkCopy.WriteToServerAsync Method (IDataReader)
.
SpreadsheetGear 加载整个 excel 文件。
我与他们的技术支持人员确认了这件事,他们回复了我
"our product is a full-fledged spreadsheet component with a
calculation engine and rich workbook manipulation capabilities.
Because of this, we must load an Excel file in its entirety—unlike
other third-party spreadsheet products out there which might be able
to get away with only partially loading parts of the file here or
there"
SpreadsheetGear 适用于需要执行某些计算和工作簿操作的情况。
我的要求只是从批量 excel 文件导入数据,所以我切换到 OLE DB 并使用 SQLBulkCopy class 和数据 reader.
我想使用 SpreadhsheetGear
读取大量 excel 文件 public ValueFormulaSet ReadData(string sheetName, string address)
{
var wrksh = this.Workbook.Worksheets[sheetName];
var range = wrksh.Range[address];
var result = new ValueFormulaSet();
result.RowCount = range.RowCount;
result.Values = (object[,])range.Value;
result.Formulas = (object[,])GetFormulas(range);
return result;
}
我想知道这种方法会读取整个数据并将其填充到 result.Values
由于我想使用批量数据文件,这种方法可能会占用大量内存。
有没有其他方法可以改进内存优化方法?
我不知道 SpreadhsheetGear 如何处理批量文件。
我正在寻找一些延迟加载方法,通过它我可以做一些缓冲,
或者我想做一些像实现 IDataReader
和使用 SqlBulkCopy.WriteToServerAsync Method (IDataReader)
.
SpreadsheetGear 加载整个 excel 文件。 我与他们的技术支持人员确认了这件事,他们回复了我
"our product is a full-fledged spreadsheet component with a calculation engine and rich workbook manipulation capabilities. Because of this, we must load an Excel file in its entirety—unlike other third-party spreadsheet products out there which might be able to get away with only partially loading parts of the file here or there"
SpreadsheetGear 适用于需要执行某些计算和工作簿操作的情况。 我的要求只是从批量 excel 文件导入数据,所以我切换到 OLE DB 并使用 SQLBulkCopy class 和数据 reader.