Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. New to Asp.Net

New to Asp.Net

Scheduled Pinned Locked Moved ASP.NET
csharpasp-netxmltutoriallearning
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    drc_no1
    wrote on last edited by
    #1

    Hi! I'm verry new to asp.net, but i've worked before with C# and it's quite easy learning. one of the things i don't know is how to acces the data in App_Data folder. i have an .xml file i want to load into a dataset. the website works on localhost when i have the path set as "c:\\Project Data\\Denumiri.xml", another folder where i have my files. Still, i want to include the .xml files in the project and access them. ds_Denumiri1.ReadXml("\App_Data\Denumiri.xml", XmlReadMode.ReadSchema); Thanks a lot for your answer!

    G 1 Reply Last reply
    0
    • D drc_no1

      Hi! I'm verry new to asp.net, but i've worked before with C# and it's quite easy learning. one of the things i don't know is how to acces the data in App_Data folder. i have an .xml file i want to load into a dataset. the website works on localhost when i have the path set as "c:\\Project Data\\Denumiri.xml", another folder where i have my files. Still, i want to include the .xml files in the project and access them. ds_Denumiri1.ReadXml("\App_Data\Denumiri.xml", XmlReadMode.ReadSchema); Thanks a lot for your answer!

      G Offline
      G Offline
      Guffa
      wrote on last edited by
      #2

      The ReadXml method is not specific for the web, so it doesn't use a logical path. Use Server.MapPath("~/App_Data/Denumiri.xml") to get the physical path to the file.

      --- b { font-weight: normal; }

      D 2 Replies Last reply
      0
      • G Guffa

        The ReadXml method is not specific for the web, so it doesn't use a logical path. Use Server.MapPath("~/App_Data/Denumiri.xml") to get the physical path to the file.

        --- b { font-weight: normal; }

        D Offline
        D Offline
        drc_no1
        wrote on last edited by
        #3

        THANKS A LOT!! it was useful... i compiled it and it works on localhost. still, i get an error when i try to run it remotely, on http://drcnoib.somee.com[^] . i've set the customerror mode="Off" in web.config, but i still get that error. i think the error comes from page_load event: protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { ds_Denumiri1.ReadXml(Server.MapPath("~/App_Data/Denumiri.xml"), XmlReadMode.ReadSchema); ds_Denumiri2.ReadXml(Server.MapPath("~/App_Data/Denumiri.xml"), XmlReadMode.ReadSchema); DropDownList1.DataSource = ds_Denumiri1.Tables[0]; DropDownList2.DataSource = ds_Denumiri2.Tables[0]; DropDownList1.DataTextField = ds_Denumiri1.Tables[0].Columns["Statie_Nume"].ToString(); DropDownList2.DataTextField = ds_Denumiri2.Tables[0].Columns["Statie_Nume"].ToString(); DropDownList1.DataValueField = ds_Denumiri1.Tables[0].Columns["StatieID"].ToString(); DropDownList2.DataValueField = ds_Denumiri2.Tables[0].Columns["StatieID"].ToString(); DropDownList1.DataBind(); DropDownList2.DataBind(); } } but i don't know how to find out which is the error or when it occurs. :sigh: :( . thanks a lot, anyway. -- modified at 10:24 Monday 28th August, 2006

        1 Reply Last reply
        0
        • G Guffa

          The ReadXml method is not specific for the web, so it doesn't use a logical path. Use Server.MapPath("~/App_Data/Denumiri.xml") to get the physical path to the file.

          --- b { font-weight: normal; }

          D Offline
          D Offline
          drc_no1
          wrote on last edited by
          #4

          got it... the .net version of the site was set to 1.1, not 2.0 .... THANK YOU!!

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups