SqlCommand.ExecuteXmlReader
を使用して取得したXmlReader
を使用しています。System.Xml.XmlException:名前の解析中に予期しないファイルの終わりが発生しました
XDocument currentXDoc = XDocument.Load(ktXmlReader.ReadSubtree());
それが期待通りに最初の製品のノードに読んで、初めての作品:
私はこのコード行を実行します
。それが実行される第二の時間、私は次の例外を取得:
System.Xml.XmlException:
Message: Unexpected end of file while parsing Name has occurred. Line 1, position 2048.
Stacktrace: at System.Xml.XmlTextReaderImpl.Throw(String res, String arg)
at System.Xml.XmlTextReaderImpl.ParseQName(Boolean isQName, Int32 startOffset, Int32& colonPos)
at System.Xml.XmlTextReaderImpl.ThrowTagMismatch(NodeData startTag)
at System.Xml.XmlTextReaderImpl.ParseEndElement()
at System.Xml.XmlTextReaderImpl.ParseElementContent()
at System.Xml.XmlSubtreeReader.Read()
at System.Xml.Linq.XContainer.ReadContentFrom(XmlReader r)
at System.Xml.Linq.XContainer.ReadContentFrom(XmlReader r, LoadOptions o)
at System.Xml.Linq.XDocument.Load(XmlReader reader, LoadOptions options)
私は私に似ていたthis questionとthis questionを見つけたが、私は私ができる(私のXMLが整形式であるかなり確信していますこれまでのところ)
私のアイデアをSPROCを実行しているから直接それを得る:
- 2048は、コンピュータでは非常に疑わしい数です。
XDocument
またはXmlReader
に2KBの制限がありますか? whileループで - 私ktXmlReader.Read()は何とか他のすべてのノードをスキップして
http://forums.asp.net/t/1191911.aspx – Codeman