المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Out of Memory Exception while reading Text File



C# Programming
06-29-2009, 05:50 PM
Hi,
My requirement is to read the file one by one and update the content in database.

I'm getting Out of memory Exception while reading 32Mb text file. I ve used streamReader to read the File.

StreamReader strReader = new StreamReader(filePath);
return strReader.ReadToEnd();

I have tried with ReadLine() also. Same error comes.

Is there any solutions for this?

Thanks in advance