How to convert XML data to gridview
I am creating a Web site which retrieves data from the expedia site. The data comes in the XML format. Could you please let me know the best method to display them in a gridview?
XML response can be found in http://ean开发者_C百科.mashery.com/docs/read/hotels/version_3/request_hotel_list/examples/XML_Basic_Availability
I see lot of example on how to convert the xml file into dataset but not able to find the samples to setup the gridview using the XML response (not an.xml file)
Take a look at XmlDataSource
http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.xmldatasource.aspx
It's an XmlDocument.
It's a DataSet.
It's both! The XmlDataDocument:
http://msdn.microsoft.com/en-us/library/system.xml.xmldatadocument.aspx
[Edit] I saw that class has recently become obsolete. You can still use a DataSet or DataTable. They have WriteXml() and ReadXml() methods.
精彩评论