Can't get attributes from DataSet filled from xml file
Hi,
I am wondering if it's possible to get attribute of an xml file with a DataSet (not a XmlDataReader) ?
I can get the name of attributes from a row but not the value.
Any idea ? Or just tell me if I have not to use attributes.
Thanks
Ad
Hi,
You can use Attributes with a Dataset. Here is an example XML :
<Groups>
<Group Name="Information Technology" ID="IT" Description="Information Technology" />
<Group Name="Finance" ID="Fin" Description="Finance Group" />
<Group Name="Hyperion" ID="Hyp" Description="Individuals requiring access to Hyperion." />
<Group Name="Legal" ID="Leg" Description="Legal" />
</Groups>
For the above XML when loaded into a Dataset, the attributes:
Name, ID and Description would be column names and u can access it as follows:
(assuming the DataSet object name to be dsetData)
dsetData.Tables[0].Rows[0]["ID"]
Regards,
Vikram