linq

http://stackoverflow.com/questions/4526734/how-to-read-xml-file-using-linq-in-c

http://www.techrepublic.com/blog/programming-and-development/access-xml-data-using-linq-to-xml/594


http://weblogs.asp.net/scottgu/archive/2007/08/07/using-linq-to-xml-and-how-to-build-a-custom-rss-feed-reader-with-it.aspx

http://www.dbtutorials.com/retrieve/linq-to-xml-cs.aspx
XDocument xmlDoc = XDocument.Load(Server.MapPath("personkrs.xml"));

var persons = from person in xmlDoc.Descendants("Person")
select new
{
Name = person.Element("Name").Value,
City = person.Element("City").Value,
//Age = person.Element("Age").Value,
};
GridView1.DataSource = persons;
GridView1.DataBind();





Paxton
Munich
29


Mike
Orlando
33


Ella
LA
13


Ingrid
Oslo
63

No comments:

Post a Comment