I'm trying to figure out which column an XML attribute belongs to when
read into a dataset. Take the following XML fragment:
<FileList>
<file name="file1"></file>
<file name="file2"></file>
</FileList>
How would I get out the file name?
I have the code below so far.
Thank for any help!
--Brent
====================================
//after successfully getting a bit of XML from http
XmlTextReader xmlReader = new XmlTextReader(sr);
DataSet ds = new DataSet();
ds.ReadXml(xmlReader);
DataTable tableFiles = ds.Tables["FileList"];
for (int i = 0; i < tableFiles.Rows.Count; i++)
{
object[] fileRow = tableFiles.Rows[i].ItemArray;
//Here's where I can't seem to get the XML attribute
//What "column" is the XML "name" attribute located in?
string fileName = fileRow.GetValue(0); //<--DOES NOT WORK
}