Selection from an XML file (easy?)

  • Thread starter Thread starter Andy
  • Start date Start date
A

Andy

Hi,
I want to fill a dataset with results from a team. This can then be
bound to a datagrid. I am looking to fill one or more datasets with
queries similar to "The most recent 5 results", or "All youth team
results".
It shouldn't be that hard but is escaping me at present. I can do
this till the cows come home in SQL, but I'm new to working with XML
files...
Any help would be *most* appreciated.

Thanks in advance.
R.

example XML file...

<games>
<game>
<team>youth</team>
<date>12/12/04</date>
<result>2:0</result>
</game>
<game>
<team>mens</team>
<date>10/02/04</date>
<result>1:1</result>
</game>
</games>
 
With XML, you have to select all nodes that have a specific value. Since you
are actually looking at child nodes, XPath is probably your best option.
Now, if you can get a DataSet filled, you can easily use a DataView to
filter so only the items you wish to show are shown. This may be the
easiest. NOTE, however, that you may have to run an XSL transformation on
the XML to get it into the proper format for your DataSet.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

************************************************
Think Outside the Box!
************************************************
 
Back
Top