Raja

Raja

  • 539
  • 2k
  • 345.7k

How To convert particular row and column of excel to dataset

Nov 17 2016 4:16 AM
FileStream stream = File.Open(SourceUpload.Fullpath, FileMode.Open, FileAccess.Read);
IExcelDataReader excelReader = ExcelReaderFactory.CreateOpenXmlReader(stream);//xlsx file format
ds = excelReader.AsDataSet(); 
 
 
I have used this code to convert excel to dataset.excel have(1,048,576 rows by 16,384 columns) in that time (Exception of type 'System.OutOfMemoryException' was thrown.) exception is thrown so i want to convert only 1000 rows and columns to dataset how to do it.
i understand to delete the empty columns and rows using (ctrl -) key but the user is not well knowledged in excel so i want to convert only 1000 rows and columns how to do it.

Answers (3)