Oledb Data Adapter is failing for bulk data read of 8 Lac +


I am working on some migration project where data is exported from Oracle DB to Excel sheets. Extraction tool is different which is able to extract data to Excel around 1 Million also. In extraction tool Oracle Data reader is used and its extracting 1 Million records successfully. Even its extracting more than 1 M data as well in to multiple sheets in the same excel with multiple sheets like Sheet1,Sheet2 etc.

As per requirement, I need to read the entire excel data and store it in Data table and make the XML for my Ingestion. its working fine for below 8 lac data. But when i am trying to read the data from Excel using OleDb Data Adapter or Data Reader its failing when records exceed 8 Lac and giving error like "System Resources exceeded." My server is free and nothing is running there and its 64 GB ram as well.

Extraction separate tool which is fetching data from Oracle DB using Oracle Data reader. My tool is different which needs to read the excel data at a time and store in Data table for xml preparation of Parent and Child nodes.

Find the code snap below.

tried with both Data Adapter and Data reader.

using (var cmd = conn.CreateCommand())
cmd.CommandText = "SELECT * FROM [" + sheet + "]";
OleDbDataReader reader = cmd.ExecuteReader();


LogWriter.LogWrite("No of Files/docs to process for the File : " + inputFilePath + " Sheet Rows Count : " + dtDocExcelData.Rows.Count);

//clearing the resources

failing at Load in to Data table.

visual studio is 2013 version and code is in C#. Excel version is also latest as 2016 (.XLSX).

please check the above code part and let me know where it is failing to load the bulk data from excel. Is there any other way to resolve this.?

Provide me any other alternative solutions to over come this. Project is going to live by month end. UAT is phase is failing. please give me alternate solution at earliest.

Awaiting for your valuable suggestions. Thanks in advance.