i have xml file like
and then i have Two TextBoxes and One Button
i am enter a value in text box1 then i click button it ll go and get the matching value and display textbox2.
for example in above xml file i enter txtbox1(30) and i click button I want to dispaly textbox2(6.12)
txtbox(28) ....txtbox2(6.02)....like that
please give me any idea how to match and get it.
Thanks
Venkat.S

Pradeep ChandrakerPosted Jun 20, 2011, 10:20 AM
XDocument.Parse is used when you have xml string.
XDocument.Load is used when you have xml file.
Anyway thats great you found solution.
Venkat SPosted Jun 20, 2011, 4:44 AM
i got the solution
the above code just change into parse to load.
XDocument oXDoc = XDocument.Load(path + @"\Refrigirater.xml");
var val = from p in oXDoc.Element("DATAPACKET").Elements("data1") where p.Element("R_PRE").Value == textBox2.Text select p.Element("R_TEMP").Value;
textBox3.Text = val.First().ToString();
thanks for give idea.
Venkat SPosted Jun 20, 2011, 3:32 AM
thanks for replay,
here we have small problem all data in my xml file then how to call them ...
but i try to give the path get an error.
Xml Exception
Data at the root level is invalid. Line 1, position 1.
Pradeep ChandrakerPosted Jun 20, 2011, 2:43 AM
I made one change in your xml string, I added root element "".