Problem in retrieving data from a XML file

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • splendid9
    New Member
    • Mar 2008
    • 56

    Problem in retrieving data from a XML file

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

    Code:
    protected void Page_Load(object sender, EventArgs e)
        {
    
            DataSet ds = new DataSet();
            ds.ReadXml(MapPath("prod.xml"));
            DataGrid grid1 = new DataGrid();
            grid1.DataSource = ds;
            grid1.DataBind();
    
    
        }
    
    <?xml version="1.0" encoding="utf-8" ?>
    <Productlist>
      <Products>
        <ProductID>1</ProductID>
        <Name>pro1</Name>
      </Products>
      <Products>
        <ProductID>2</ProductID>
        <Name>pro22</Name>
      </Products>
    </Productlist>
    
    <asp:GridView ID="grid1" runat="server">
            </asp:GridView>
    Last edited by RedSon; Jun 26 '08, 08:14 PM. Reason: CODE tags
  • RedSon
    Recognized Expert Expert
    • Jan 2007
    • 4980

    #2
    Next time please use code tags. It is not a request.

    Comment

    • splendid9
      New Member
      • Mar 2008
      • 56

      #3
      what code tags........... ...? do u know solution for my problem?

      Comment

      • RedSon
        Recognized Expert Expert
        • Jan 2007
        • 4980

        #4
        If you click on post reply, read the reply guidelines!

        Comment

        • splendid9
          New Member
          • Mar 2008
          • 56

          #5
          ok is my ques deleted now? i am not getting any replies???????

          Comment

          • RedSon
            Recognized Expert Expert
            • Jan 2007
            • 4980

            #6
            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.

            Comment

            • jkmyoung
              Recognized Expert Top Contributor
              • Mar 2006
              • 2057

              #7
              Could you be more specific in terms of the problem? Are you getting error messages? Is any of the data loaded?

              Comment

              • splendid9
                New Member
                • Mar 2008
                • 56

                #8
                No i am not getting any error messages, just a blank aspx page,.....witho ut any data...i am just trying to display the data from xml file onto aspx page,...

                Comment

                Working...