XMLDocument, Dataset, DataGrid and a hyphen

Hello everyone. I have a quick question.

I am working with an XML document that I want to put into a DataGrid. I have successfully managed to do this by:

myDataSet = New Data.DataSet()
myDataSet.ReadXml(
New StringReader(xmlDoc.InnerXml))

I know I probably could do it with an XmlDataDocument, but it wasn't working for me, as this XML is generated on the fly.

Now, when I go to put the dataset into a datagrid, all the data comes out fine, except for columns with a hyphen in it's name...the values within this column are coming back as null, when I know there should be values there.

The data is being imported from either Excel or Access (whichever the user chooses.) I have properly escaped all of the characters in the column names, so let's say that I have a column named "pre-emptive multitasking", the xml tag would be "pre_x002D_emptive_x0020_multitasking". In theory this should be correct, as it passes XML validation.

I checked through the dynamically generated XML file, and the values are there. Where should I look for the error Does my problem with hyphens stem from the DataSet, or from the DataGrid

Thanks!
ASP.Confused



Answer this question

XMLDocument, Dataset, DataGrid and a hyphen