c# - How to read large XML RAW from Linq to SQL? -


I want to connect Linux to SQL & amp; Linc has got together some code on XML, which puts XML results in an accumulation process from an archived process. However, this is failing, apparently now that the XML data is growing (2K +) and my Reading parse broken XML (XML data comes back in two rows). Before I start the fall in weeds using XMLReaders and all this, maybe I see it wrong and have a better viewpoint.

My exact problem is down, but I have idioms for any standard Linq talk of this type.


The specific error I am getting is

System.Xml.XmlException: The name is while parsing the unexpected end of the file. Line 1, position 2034

My C # code is something like this

  XDocument Command = New XDocument (Select from db.GetUserOrders (userid) in B. XElement.Parse ( B.XML_F52E5B62_58B1_21e2_B105_00805A49AB12));  

looks like stored proc

  select * where userid = @userid command xml tscreated for raw ('order'), route (' Command ')  

XML from the stored proc

  & lt; Order & gt; & Lt; Order order id = "123" user id = "bob" tscreated = "2010-07-16T16: 46: 46.173" & gt; & Lt; Morexml & gt; & Lt; Element1 & gt; & Lt; Element2 & gt; ABC & lt; / Element2 & gt; & Lt ;! - more accessories - & gt; & Lt; / Element1> & Lt; / Morexml & gt; & Lt; / Order & gt; & Lt ;! - Too many orders - & gt; & Lt; / Order & gt;  

I forgot to update it with an answer, but @titan Tune's comment given, I'm doing what I am doing in this code: Digging:

  var o = choose cfg.db.OsGetUserOrders (userid) in the save ordsXML_F52E5B62_58B1_21e2_B105_00805A49AB12; Stringbilder sb = new stringbiller (); Sb.AppendFormat (" {0} ", string .joint ("", O. ToArray ()); Excelment xe = excelment.paras (sb thostring ());  

Basically, the stored proc gives several orders elements, and this code covers them in an array, then they are found in the string. Then I parse it in a XElement. Probably a better way, and I'm open to other solutions.


Comments