Hi,
I have two csv files Say 'File1.csv" (# records 3239972) & "File2.csv" (# 8927549).
So what I am doing Is I am polulating dataset by reading File Line by Line as.
DataTable dtCsv = new DataTable();
int i = 0;
foreach (var line in File.ReadLines(FilePath))
{
DataRow dr = dtCsv.NewRow();
//Set dr for columns
dtCsv.Rows.Add(dr); //add other rows
}
return dtCsv;
==================
This works fine for 'File1.csv" (# records 3239972)
but give an error 'System.OutOfMemoryException' after processing Row # 8147077 added to datatable
Please help its nightmare for me and client is sitting on my head :(
Sanjay SharmaPosted Aug 23, 2019, 6:55 AM
Resolution - Visual Studio (VS) build any application by default targeting 32-bit. This option can lead into 'OutOfMemoryException' (Although limit is very Huge).
I have change the build target Platform to 64.
Prefer 32 bit should kept UnChecked.
Amit MohantyPosted Aug 22, 2019, 11:36 PM
Rajanikant HawaldarPosted Aug 22, 2019, 12:08 PM
Sanjay SharmaPosted Aug 22, 2019, 11:52 AM
Rajanikant HawaldarPosted Aug 22, 2019, 8:34 AM