none
Problem when saving DataSet to XML by using its WriteXml() method, e.g. inconsistent xml structure and returned error. RRS feed

  • Question

  • Dear all,

    My problem is as follows. The xml file that I manipulate with is as follows, e.g.

    <s m="B">
    <p>
    <i>1</i>
    <t>3</t>
    <r>5</r>
    </p>
    <p>
    <i>2</i>
    <t>Not applicable</t>
    <r>2</r>
    </p>...
    <p>...</p>
    </s>

    The dataSet is filled by the xml, and bounded with the datagridview by setting the dataSource to dataSet. If I saved the modified dvg by using dataSet.WriteXML() with WriteSchema mode. The saved xml file is as follows, e.g.

    <NewDataSet>
    <xsTongue Tiedchema>
    ...
    </xsTongue Tiedchema>
    <s m="B"/>
    <p>...</p>
    <p>...</p>
    </NewDataSet>

    Originally, the "p" should be the child node of "s". However, it is not here. I don' know how the node "NewDataSet" is generated. If I set the writeMode to be the Ingoreschema, the error "Token StartElement in state Epilog would result in an invalid XML document." is returned. Saving failed.

    Can you give me a hand with this problem?

    Thanks,

    B.W.

    B-D

    Wednesday, August 1, 2007 3:09 AM

Answers

  • It is figured out in the other post, refer to the following link for the details,

    http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1944906&SiteID=1
    Friday, August 3, 2007 2:56 PM