Actually, that depends on a lot.
Has it to be high performant?
Do you have to search in the xml file?
Do you need to do some transformation of the xml file?
....
You can find a lot of documentation about this on the internet.
For example, a nice document of the different way's you can use, can you
find at
http://support.softartisans.com/kbview.aspx?ID=674
It describes the most commenly used way's to access the data in xml files,
and also mentions when to use which way.
If I had to choose, I'd use the XPathNavigator when I have to search in the
xml file for values needed to populate the checkboxlist (for example when you
have a very large xml file, with somewhere in it the values you need).
At the other hand, what is not mensioned in the document, but might be
interesting :
When you have a simple xml file structure, and you are going to use it (or
xml files with are identically in structure) a lot. And when the structure of
the xml file will not change, then I would create a new class for it.
(This is very simple : In VS2003, include an example xml file in the
project, double click on it, richt click on the document, generate a schema
for it, open that one, richt click and create a dataset from it. At that
moment a new class is created, which inherents from DataSet. This class you
can use to 'ReadXml' and 'WriteXml' to create and save a 'dataset'.
Kind regards,
Michel
"me" wrote:
Hello,
I have a novice question:
How do you populate a checkboxlist with XML data?
TIA