Loading XML to Dataset using partial XSD creating blank rows in dataset tables. RRS feed

  • Question

  •  I am loading a dataset schema from an xsd and data from an xml string. My code is:


    'get XML schema; load to TextReader for ds.ReadXMLSchema
     Dim txtReaderXMLSchema As System.IO.TextReader = New System.IO.StringReader(strApplicationxsD)
    'get diffgram content from input Dataset; load to TextReader for dataset's read XML 
    Dim txtReaderXMLContent As System.IO.TextReader = New System.IO.StringReader(ToStringAsXml(dsDfgrm))
    ds.ReadXml(txtReaderXMLContent, XmlReadMode.DiffGram)

    If my xsd has definition for all the tables present in XML, the dataset table loads fine but in case, the schema has only one table definition, blank rows are added in datatables.

    I observed the table names and column names are same and think that is causing the problem.Why are the blank rows getting added?

    • Edited by Chota Hathi Friday, January 6, 2012 3:32 PM
    • Moved by John Saunders Tuesday, January 10, 2012 2:45 AM dataset issue (From:ASMX Web Services and XML Serialization)
    Thursday, January 5, 2012 3:46 PM


All replies