Hi! Any idea how I can perform search in XML file and then selected search result will appear in WebForm.
Briefly, I have few text boxes and my serach will be based on the keyword entered in those text boxes. Can anyone please give me idea for this. Thanks a lot for the answer.
RP
PalPosted Aug 13, 2008, 10:56 PM
Bechir BejaouiPosted Aug 13, 2008, 7:08 PM
myDocument.Load(@"C:\XmlFile.xml");
XmlNodeList oNodeList = myDocument.SelectNodes("/Element");
txt0.text = oNodeList[0].innerText;
txt1.text = oNodeList[1].innerText;
.
.
tx[n].text = oNodeList[n].innerText;
or if you want to select node by node then use
selectsinglenode instead of SelectNodes
and xmlnode instead of xmlnodelist