3
Answers

How To convert particular row and column of excel to dataset

Raja

Raja

8y
216
1
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)
2
Amit Gupta

Amit Gupta

NA 16.5k 25.6k 8y
Check out the below two links http://stackoverflow.com/questions/34629987/how-can-we-read-data-from-specific-row-or-column-in-excel http://www.codeproject.com/Questions/554873/howplustoplusreadplusplusspecificpluscolumnsplusin
1
Amit Gupta

Amit Gupta

NA 16.5k 25.6k 8y
@Raja
 
You can use Range keyword to get the data between the range or it also show the loop to get the value and break until you acheive your rows
0
Raja

Raja

NA 1.7k 45.2k 8y
Hi
 

Amit Gupta

This is not working already try this one.