Attached is a sample xml file. When I read the Xml file into the dataset using ds.ReadXml, it seems to populate every datatable with an additional column, which is not in the schema or the data layout, with “0” as the value. How can I eliminate this extra column, and why does it appear?
In your file:
Please try to remove :
Thank you, Laurence. I will try and see if it works.
I do not think that is the problem. In the Data sheet, the DataType column is displayed in the correct sequence, with a blank value in each row. The extra column is titled “graph_Id”, which appears nowhere in the XML file. It is the seventh column, whereas there are only 6 elements (columns) in the GraphDataPoint table. This is also happening for all other tables populated into the dataset from the XML.
Using the dataset created from the same XML file attached to this issue earlier, I wrote some code to get the "series" table into a DataView and set the Sort property to "seqNo ASC". It does not sort on seqNo. I moved the "series" elements around to make sure they are not in order of seqNo. I know that this is not a question directly related to the Aspose.Cells component, but would you have any idea as to why the DataView will not sort?
The sort function seems to work fine in other parts of my application for some other tables from the dataset.
Here is the problematic code:
DataView dv = ds.Tables["series"].DefaultView;
if (ds.Tables["series"].Rows["seqNo"].ToString() != "")
dv.Sort = "seqNo ASC";
And then I use dv.Table to retrieve the data, but it is not sorted.
Please use dv to retrieve data instead of using dv.Table to retrieve data. The dataview is sorted but the datatable is not.
Thanks a lot, Laurence. That worked. I appreciate your assistance in this though this was not a question directly related to your product.