src/ExcelReader/ExcelReader.cs
/// <summary>
/// Returns datatable object from the excel file with values retrieved as strings.
/// </summary>
/// <param name="bytes">Excel file bytes.</param>
/// <param name="options">Settings you might want to change.</param>
Returns datatable object from the excel file with values retrieved as strings.
Returns datatable object from the excel file with values retrieved as strings .
public static DataTable ToDataTable(byte[] bytes, ExcelReaderOptions options = null)
        {
            if (bytes == null) throw new ArgumentNullException(nameof(bytes));
            options = LoadOptions(options);
            IWorkbook workbook;
            using var stream = new MemoryStream(bytes);
            workbook = LoadWorkbook(stream, options);
            ISheet sheet = LoadSheet(options, workbook);
            return ToDataTable(sheet, options);
        }
public static DataTable ToDataTable ( byte [ ] bytes , ExcelReaderOptions options = null ) { if ( bytes == null ) throw new ArgumentNullException ( nameof ( bytes ) ) ; options = LoadOptions ( options ) ; IWorkbook workbook ; using var stream = new MemoryStream ( bytes ) ; workbook = LoadWorkbook ( stream , options ) ; ISheet sheet = LoadSheet ( options , workbook ) ; return ToDataTable ( sheet , options ) ; }
Returns datatable object from the excel file with values retrieved as strings.
Returns datatable object from the excel file with values retrieved as strings .
bytes
byte[]
Excel file bytes.
Excel file bytes .
options
ExcelReaderOptions
Settings you might want to change.
Settings you might want to change .