simple xml read question

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
Hello All gurus,
I have a simple xml read question. I attached my code here.
<div style="color:Black;background-color:White; <pre>
<span style="color:Blue; public DataSet getSpecificXmlData(<span style="color:Blue; string strFilePath, <span style="color:Blue; string strBusinessNo)
{
XmlDataDocument docData = <span style="color:Blue; new XmlDataDocument();
DataSet ds = <span style="color:Blue; new DataSet();
<span style="color:Blue; using (XmlTextReader reader = <span style="color:Blue; new XmlTextReader(strFilePath))
{
reader.ReadToFollowing(strBusinessNo);
<span style="color:Blue; do
{
docData.DataSet.ReadXml(reader);

} <span style="color:Blue; while (reader.MoveToElement());
ds = docData.DataSet;
ds.AcceptChanges();
<span style="color:Blue; return ds;
}
}
[/code]
Heres my xml file
<div style="color:Black;background-color:White; <pre>
<span style="color:Blue; <?<span style="color:#A31515; xml <span style="color:Red; version<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; 1.0<span style="color:Black; " <span style="color:Red; standalone<span style="color:Blue; =<span style="color:Black; "<span style="color:Blue; yes<span style="color:Black; "<span style="color:Blue; ?>
<span style="color:Blue; <<span style="color:#A31515; dataSet<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; SHXF1110160023<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; a<span style="color:Blue; >a<span style="color:Blue; </<span style="color:#A31515; a<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; b<span style="color:Blue; >b<span style="color:Blue; </<span style="color:#A31515; b<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; c<span style="color:Blue; >c<span style="color:Blue; </<span style="color:#A31515; c<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; d<span style="color:Blue; >xxx<span style="color:Blue; </<span style="color:#A31515; d<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; e<span style="color:Blue; >123<span style="color:Blue; </<span style="color:#A31515; e<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; f<span style="color:Blue; >test<span style="color:Blue; </<span style="color:#A31515; f<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; SHXF1110160023<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; SHXF1110160023<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; a<span style="color:Blue; >a<span style="color:Blue; </<span style="color:#A31515; a<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; b<span style="color:Blue; >b<span style="color:Blue; </<span style="color:#A31515; b<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; c<span style="color:Blue; >c<span style="color:Blue; </<span style="color:#A31515; c<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; d<span style="color:Blue; >yyy<span style="color:Blue; </<span style="color:#A31515; d<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; e<span style="color:Blue; >22<span style="color:Blue; </<span style="color:#A31515; e<span style="color:Blue; >
<span style="color:Blue; <<span style="color:#A31515; f<span style="color:Blue; >test2<span style="color:Blue; </<span style="color:#A31515; f<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; SHXF1110160023<span style="color:Blue; >
<span style="color:Blue; </<span style="color:#A31515; dataSet<span style="color:Blue; >
[/code]

But like my previous code, it just return the first record, i want to return all records(elements) which meet condition <span style="white-space:pre strBusinessNo.
<span style="white-space:pre How to modify it.
<span style="white-space:pre Thanks,
<span style="white-space:pre Werewolf, <hr class="sig <b>Just a newbie for everything.</b>

View the full article
 
Back
Top