I want to read below mentioned xml file and displaying it in gridview.
<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:g="http://base.google.com/ns/1.0">
<channel>
<title>AspDotNetStorefront</title>
<description></description>
<language>en-US</language>
<pubDate>Sat, 26 Mar 2011 06:39:12 GMT</pubDate>
<lastBuildDate>Sat, 26 Mar 2011 06:39:12 GMT</lastBuildDate>
<item>
<title>Playstation 3</title>
<description><img border="0" id="ProductPic1" name="ProductPic1" style="cursor:hand;cursor:pointer;" src="/images/Product/icon/1.jpg" />As DVD playback made.</description>
<g:price>399.99</g:price>
<g:brand>Sony</g:brand>
<g:condition>NEW</g:condition>
<g:location>Gift and Home</g:location>
<g:mpn>01-0001</g:mpn>
</item>
<item>
<title>PlaysStation Portable(PSP)</title>
<description><img border="0" id="ProductPic2" name="ProductPic2" style="cursor:hand;cursor:pointer;" src="/images/Product/icon/2.jpg" />The PSP is primarily a game console (PSP games come in UMD, or Universal Media Disc, format), but it can also play UMD-format movies. Using a memory stick, the PSP can play music and video files, and display picture files such as photos. This portable console can also connect to the internet via a web browser (not incuded in early firmware releases) and built-in wi-fi.</description>
<g:price>169.00</g:price>
<g:brand>Sony</g:brand>
<g:condition>NEW</g:condition>
<g:location>Gift and Home</g:location>
<g:mpn>01-0002</g:mpn>
</item>
</channel>
</rss>
Abhimanyu K VatsaRank #14 · 51.6K pointsPosted Mar 26, 2011, 6:09 AM EDT
DataSet dsContacts = new DataSet();
dsContacts.ReadXml(Server.MapPath("yourfilename.xml"));
GridView1.DataSource = dsContacts;
GridView1.DataBind();
remember to map your file properly.
raiees wani5 pointsPosted Mar 27, 2011, 10:54 PM EDT