Click here to Skip to main content
15,892,746 members
Please Sign up or sign in to vote.
2.00/5 (3 votes)
See more:
Hi,

When I am trying to parse a string value which has a huge text, then I am getting system out of memory exception.

I am using below code.

C#
foreach (KeyValuePair<string,> item in newXMlValue)
   {
       XElement node = (from c in orderXML.Descendants(item.Key) select c).FirstOrDefault();
       if (!object.Equals(node, null))
       {
          XElement xmlValue = XElement.Parse(item.Value.ToString());  // Here I am getting system out of memory Exception

          node.ReplaceWith(xmlValue)
        }
    }


Please help me to solve this problem.

Thanks
Posted
Updated 17-Apr-14 10:49am
v5
Comments
Rob Philpott 17-Apr-14 4:41am    
How big is the string?? Have you considered using a forward reader?
Ck Nitin 17-Apr-14 11:04am    
I converted a 19 MB size pdf file as binary data and that string contains this binary data. No I did not use forward read. Could you please Hi can I use it.

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900