Author: klbaiju | Posted on: 10/8/2009 9:25:34 PM | Views : 244

 this is my xml file
<Persons>
<Person>
<ID>100</ID>
<Name>tom</Name>
<City>LA</City>
<Age>22</Age>
<ID>101</ID>
<Name>sam</Name>
<City>CA</City>
<Age>18</Age>
</Person>
<ID>102</ID>
<Name>peter</Name>
<City>GA</City>
<Age>28</Age>
</Persons>
i want to display a particular record by id and city using function
Public string displayresult(int Id,String city)
{
 
XDocument xmlDoc=XDocument.Load(Server.MapPath("people.xml"));
Var persons=from p in xmlDoc.Descendants("Person")
where p.Element("ID").Value==Id and p.Element("City").value==city
select new
{
Name=p.Element( ...

Go to the complete details ...