I have an XML file that contains.
<Data>
<Employees>
<Employee>
<FirstName>joe</FirstName>
<Surname>bloggs</Surname>
</Employee>
<Employee>
<FirstName>harry</FirstName>
<Surname>potter</Surname>
</Employee>
<Employees>
<Sites>
<Site>
<SiteName>London</SiteName>
</Site>
</Sites>
</Data>
I also have created a form, with a combo box on it with two values ("Employees" and "Sites") and a datagrid.
The idea being that when the user selects an entry in the combo, the datagrid fills with the relevant details from the xml. For example a user selects 'Employees', the datagrid shows:
FirstName | Surname
--------------------
joe | bloggs
harry | potter
etc..
If a change is made to these details, I need to update the xml file.
I'm struggling on two items, which I would like some help on!:
- Once I've populated the dataset with the xml, how do I then only load the xml into the datagrid, based on the combo selection? e.g. if "Employees" is selected, only should information for each <employee> in <employees>...
- If data is changed in the grid, will I be able to simply update the xml from the dataset (presuming the dataset in bound to the datagrid).
Thanks guys!
------------------------
Hit any User to continue
<Data>
<Employees>
<Employee>
<FirstName>joe</FirstName>
<Surname>bloggs</Surname>
</Employee>
<Employee>
<FirstName>harry</FirstName>
<Surname>potter</Surname>
</Employee>
<Employees>
<Sites>
<Site>
<SiteName>London</SiteName>
</Site>
</Sites>
</Data>
I also have created a form, with a combo box on it with two values ("Employees" and "Sites") and a datagrid.
The idea being that when the user selects an entry in the combo, the datagrid fills with the relevant details from the xml. For example a user selects 'Employees', the datagrid shows:
FirstName | Surname
--------------------
joe | bloggs
harry | potter
etc..
If a change is made to these details, I need to update the xml file.
I'm struggling on two items, which I would like some help on!:
- Once I've populated the dataset with the xml, how do I then only load the xml into the datagrid, based on the combo selection? e.g. if "Employees" is selected, only should information for each <employee> in <employees>...
- If data is changed in the grid, will I be able to simply update the xml from the dataset (presuming the dataset in bound to the datagrid).
Thanks guys!
------------------------
Hit any User to continue