TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Sanjay Sharma
1.3k
413
27.7k
Exception of type 'System.OutOfMemoryException' was thrown.
Aug 22 2019 8:14 AM
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 :(
Reply
Answers (
5
)
Bulk Insertion of Dynamic textbox values into database
How to delete row from gridvew ,as using session?