Bug Finder

Bug Finder

  • NA
  • 7
  • 3.4k

Oledb Data reader/Adapter is failing to read bulk data

Nov 13 2018 9:30 AM
Hi,
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. I need to read the entire excel data and store it in Data table 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.
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();
dtDocExcelData.Load(reader);
LogWriter.LogWrite("No of Files/docs to process for the File : " + inputFilePath + " Sheet Rows Count : " + dtDocExcelData.Rows.Count);
//clearing the resources
cmd.ResetCommandTimeout();
cmd.Dispose();
reader.Dispose();
}
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.
Regards,
Venky

Answers (4)