By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,385 Members | 847 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,385 IT Pros & Developers. It's quick & easy.

Problem in retrieving data from a XML file

P: 56
Problem in retrieving data from a XML file.......this is my code-

Expand|Select|Wrap|Line Numbers
  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>
Jun 26 '08 #1
Share this Question
Share on Google+
7 Replies


RedSon
Expert 5K+
P: 5,000
Next time please use code tags. It is not a request.
Jun 26 '08 #2

P: 56
what code tags..............? do u know solution for my problem?
Jun 26 '08 #3

RedSon
Expert 5K+
P: 5,000
If you click on post reply, read the reply guidelines!
Jun 26 '08 #4

P: 56
ok is my ques deleted now? i am not getting any replies???????
Jun 27 '08 #5

RedSon
Expert 5K+
P: 5,000
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.
Jun 27 '08 #6

jkmyoung
Expert 100+
P: 2,057
Could you be more specific in terms of the problem? Are you getting error messages? Is any of the data loaded?
Jun 27 '08 #7

P: 56
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,...
Jun 27 '08 #8

Post your reply

Sign in to post your reply or Sign up for a free account.