0

Well the problem is that I am new to asp.net technology and I am stuck on a problem.

Now the scenario is that I have to send an HTTPrequest to another server from my page, lets say myGames.aspx and in response to the request the server sends me an XML file. Now I don't know how to handle this situation, I mean I am like a total noob :(

Also I don't have just to display the data, I have to send different fields of the XML to different databse tables, but thats a later issue, I'd first like to do some practice with the XML data just on screen before involving in sending it to database.

Yahia
  • 69,653
  • 9
  • 115
  • 144

3 Answers3

3

To play with the XML data if you are using .net version 3.5 its better to user LINQ to XML.

http://www.codeproject.com/Articles/24376/LINQ-to-XML

or

Manipulate XML data with XPath and XmlDocument (C#)

Pranay Rana
  • 175,020
  • 35
  • 237
  • 263
1

if you are get response Xml as URL Format than u can load like here

and get xml element nodes element or you can also filter linq query using below link

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

Hops some helps.

Community
  • 1
  • 1
Jignesh Rajput
  • 3,538
  • 30
  • 50
0

There's several options:

You could query the data using Linq To XML and the XDocument class. This is recommended if using .NET 3.5 or above.

You could load the data into an XmlDocument class using the LoadXml method and use XPath to SelectSingleNodes for display.

You could use an XmlReader and read the document by looping over the nodes

Community
  • 1
  • 1
Rob Stevenson-Leggett
  • 35,279
  • 21
  • 87
  • 141