Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. DataSet.WriteXML Issue

DataSet.WriteXML Issue

Scheduled Pinned Locked Moved C#
helptestingbeta-testingxmlquestion
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    Pualee
    wrote on last edited by
    #1

    Hey All, My problem is that sending XML from a web service to client works fine. Using the exact same steps to send that XML back causes a crash! The web service returns the xml string DataSet dsReturn; ... returnWriter = new StringWriter(); dsReturn.WriteXml(returnWriter, XmlWriteMode.WriteSchema); return returnWriter.ToString(); The client reads the xml string DataSet Budget; ... srWebService = new StringReader(m_wsBudget.Select("SelectWorksheetbyYearMediaCategory", sYear + "," + sMedia + "," + sCategory)); xmltrWebService = new XmlTextReader(srWebService); xmlrsService = new XmlReaderSettings(); xmlrWebService = XmlReader.Create(xmltrWebService, xmlrsService); Budget.ReadXml(xmlrWebService); This interaction works fine all the time. Using the exact same steps to send that XML back to the web service crashes. For the sake of testing, both Web Service and Client are on the same computer (my development machine). The exception is: System.Xml.XmlException: Unexpected end of file has occurred. The following elements are not closed: Comment, HeaderModify, NewDataSet. Line 525, position 31. This follows immediately after a '#' character in the Comment field of a datatable. Any advice as to why it works coming from the web service but not sending to it (the Comment field never changed)? Is there another way to easily wrap up the XML from a dataset properly? I would assume .WriteXML() would take care of formatting special characters automatically :wtf: Thanks, Pualee

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups