I want to import Excel data and store to asp.net DataTable/DataSet so I can manipulate data and store to SQL Table.
Hi Rakesh,
//Initialize an instance of Workbook by loading a spreadsheet from disc
var book = new Aspose.Cells.Workbook(myDir + “sample.xlsx”);
//Get the first worksheet
var sheet = book.Worksheets[0];
//Initialize variables to store the range of data on worksheet
int startRow = 0;
int startCol = 0;
int endRow = sheet.Cells.MaxDataRow + 1;
int endCol = sheet.Cells.MaxDataColumn + 1;
//Export data within the specified range
System.Data.DataTable table = sheet.Cells.ExportDataTable(startRow, startCol, endRow, endCol);