Login or Sign up Help | Site Map
Connecting Tech Pros Worldwide

Problem in retrieving data from a XML file

Question posted by: splendid9 (Newbie) on June 26th, 2008 06:28 PM
Problem in retrieving data from a XML file.......this is my code-

Code: ( text )
  1. protected void Page_Load(object sender, EventArgs e)
  2.     {
  3.  
  4.         DataSet ds = new DataSet();
  5.         ds.ReadXml(MapPath("prod.xml"));
  6.         DataGrid grid1 = new DataGrid();
  7.         grid1.DataSource = ds;
  8.         grid1.DataBind();
  9.  
  10.  
  11.     }
  12.  
  13. <?xml version="1.0" encoding="utf-8" ?>
  14. <Productlist>
  15.   <Products>
  16.     <ProductID>1</ProductID>
  17.     <Name>pro1</Name>
  18.   </Products>
  19.   <Products>
  20.     <ProductID>2</ProductID>
  21.     <Name>pro22</Name>
  22.   </Products>
  23. </Productlist>
  24.  
  25. <asp:GridView ID="grid1" runat="server">
  26.         </asp:GridView>
Last edited by RedSon : June 26th, 2008 at 08:14 PM. Reason: CODE tags
Would you like to answer this question?
Sign up for a free account, or Login (if you're already a member).
RedSon's Avatar
RedSon
Site Moderator
2,840 Posts
June 26th, 2008
08:15 PM
#2

Re: Problem in retrieving data from a XML file
Next time please use code tags. It is not a request.

Reply
splendid9's Avatar
splendid9
Newbie
31 Posts
June 26th, 2008
08:25 PM
#3

Re: Problem in retrieving data from a XML file
what code tags..............? do u know solution for my problem?

Reply
RedSon's Avatar
RedSon
Site Moderator
2,840 Posts
June 26th, 2008
08:34 PM
#4

Re: Problem in retrieving data from a XML file
If you click on post reply, read the reply guidelines!

Reply
splendid9's Avatar
splendid9
Newbie
31 Posts
June 27th, 2008
02:40 PM
#5

Re: Problem in retrieving data from a XML file
ok is my ques deleted now? i am not getting any replies???????

Reply
RedSon's Avatar
RedSon
Site Moderator
2,840 Posts
June 27th, 2008
02:45 PM
#6

Re: Problem in retrieving data from a XML file
Quote:
Originally Posted by splendid9
ok is my ques deleted now? i am not getting any replies???????

No its not deleted, if you can read it so can everyone else. I'll move it to the XML forum to see if you get a better response.

Reply
jkmyoung's Avatar
jkmyoung
Moderator
765 Posts
June 27th, 2008
03:05 PM
#7

Re: Problem in retrieving data from a XML file
Could you be more specific in terms of the problem? Are you getting error messages? Is any of the data loaded?

Reply
splendid9's Avatar
splendid9
Newbie
31 Posts
June 27th, 2008
07:04 PM
#8

Re: Problem in retrieving data from a XML file
No i am not getting any error messages, just a blank aspx page,.....without any data...i am just trying to display the data from xml file onto aspx page,...

Reply
Reply
Not the answer you were looking for? Post your question . . .
182,081 Experts ready to help you find a solution.
Sign up for a free account, or Login (if you're already a member).

Top XML Forum Contributors