首页 > 其他 > 详细

把DataTable中的数据拼接成XML时遇到的问题

时间:2014-02-12 19:53:04      阅读:458      评论:0      收藏:0      [点我收藏+]

错误信息:System.Web.Services.Protocols.SoapException: System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.Xml.XmlException: Name cannot begin with the ‘1‘ character, hexadecimal value 0x31. Line 1, position 918.
   at System.Xml.XmlTextReaderImpl.Throw(Exception e)
   at System.Xml.XmlTextReaderImpl.Throw(String res, String[] args)
   at System.Xml.XmlTextReaderImpl.ParseQName(Boolean isQName, Int32 startOffset, Int32& colonPos)
   at System.Xml.XmlTextReaderImpl.ParseElement()
   at System.Xml.XmlTextReaderImpl.ParseElementContent()
   at System.Xml.XmlTextReaderImpl.Read()
   at System.Xml.XmlLoader.LoadNode(Boolean skipOverWhitespace)
   at System.Xml.XmlLoader.LoadDocSequence(XmlDocument parentDoc)
   at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace)
   at System.Xml.XmlDocument.Load(XmlReader reader)
   at System.Xml.XmlDocument.LoadXml(String xml)
   at BasInfomation.BasWebService.IsExsist(String xml, Int32 tag)
   at BasInfomation.BasWebService.GetBasInfo(Int32 tag, String basInfo)
   --- End of inner exception stack trace ---
   在 System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
   在 System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
   在 DataReport.WebInf.BasWebService.GetBasInfo(Int32 tag, String basInfo)
   在 DataReport.frmAutoUpdate.DataToXml(DataTable dtXml)
发生在:

 

错误解决:

 1、改头文件:sbXML.Append("<?xml version=‘1.0‘ encoding=‘utf-8‘?>");为sbXML.Append("<?xml version=‘1.0‘ encoding=‘UTF-8‘?>");

2、

把DataTable中的数据拼接成XML时遇到的问题

原文:http://www.cnblogs.com/mengzhixingping/p/3545680.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!