读取xlsx文件蒸汽卡在写入操作期间发生磁盘错误。 (来自HRESULT的异常:0x8003001D(STG_E_WRITEFAULT))

时间:2018-02-16 09:00:32

标签: c# excel

我正在使用OfficeOpenXml;用于读取excel文件及其工作正常与其他读取文件,但对于一个特定的文件我有上面提到的错误。

check this image

public ReadExcelFile(Stream stream, string worksheet, List<ExcelColumnMapping> columnMapping, ITypeConvert typeConvert = null, int headerSize = 1)
{
    _stream = stream;
    _excelPackage = new ExcelPackage(stream);
    _worksheet = _excelPackage.Workbook.Worksheets[worksheet];
    _headerSize = headerSize;
    _rowCount = headerSize + 1;
    var mapping = ColumnMappingRowNumber(columnMapping);
    _resultColumnNumbersAndTypes = mapping.Select(x => Tuple.Create(x.Item2, x.Item3, x.Item4)).ToList();
    _converter = typeConvert ?? new ExcelTypeConvert();
    ReadLineValues();

}

0 个答案:

没有答案