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. ASP.NET and XML

ASP.NET and XML

Scheduled Pinned Locked Moved ASP.NET
databasehelpcsharpasp-netxml
4 Posts 4 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.
  • L Offline
    L Offline
    lavanya_satheesh
    wrote on last edited by
    #1

    Hi all, I want a help from you. I have an XML file in which i have my database. I want to retrive one record from it based on condition. Like we query the database like "select * from TableName where Name='soandso'". But here my database itself is an XML file. Is it possible in anyway. I have tried navigation but i am stuck. Cant seem to go forward in this. Please help me as soon as possible. Regards, Lavanya:)

    N A T 3 Replies Last reply
    0
    • L lavanya_satheesh

      Hi all, I want a help from you. I have an XML file in which i have my database. I want to retrive one record from it based on condition. Like we query the database like "select * from TableName where Name='soandso'". But here my database itself is an XML file. Is it possible in anyway. I have tried navigation but i am stuck. Cant seem to go forward in this. Please help me as soon as possible. Regards, Lavanya:)

      A Offline
      A Offline
      asithangae
      wrote on last edited by
      #2

      hai, Use this code. DataSet ds = new DataSet(); ds.ReadXml(Server.MapPath("filename with path")); //for string data DataRow[] drs = ds.Tables[0].Select("column name = '" + "needed filter value" + "'"); //for numeric data DataRow[] drs = ds.Tables[0].Select("column name = " + "filter value"); read the xml to the dataset and use needed filter in the select method of datatable object.now the drs is collection of rows satisfying your condition. iterate that and use it. i think this solves your problem. Cheers asithangae

      1 Reply Last reply
      0
      • L lavanya_satheesh

        Hi all, I want a help from you. I have an XML file in which i have my database. I want to retrive one record from it based on condition. Like we query the database like "select * from TableName where Name='soandso'". But here my database itself is an XML file. Is it possible in anyway. I have tried navigation but i am stuck. Cant seem to go forward in this. Please help me as soon as possible. Regards, Lavanya:)

        N Offline
        N Offline
        Neeraj Arora
        wrote on last edited by
        #3

        Hi Lavanya, you can use xQuery in asp.net. This article may help you. http://aspnet.4guysfromrolla.com/articles/071603-1.aspx Enjoy programming.:)

        1 Reply Last reply
        0
        • L lavanya_satheesh

          Hi all, I want a help from you. I have an XML file in which i have my database. I want to retrive one record from it based on condition. Like we query the database like "select * from TableName where Name='soandso'". But here my database itself is an XML file. Is it possible in anyway. I have tried navigation but i am stuck. Cant seem to go forward in this. Please help me as soon as possible. Regards, Lavanya:)

          T Offline
          T Offline
          Tamimi Code
          wrote on last edited by
          #4

          hi try to read your xml file into a DataSet, then user the select method for the table inside the DataSet i.e DataSet ds = new DataSet(); ds.ReadXml("Users.xml"); DataRow []arrDR = ds.Tables[0].Select("id=5"); // where id=5 is your condeition and id is a colunm name.

          When you get mad...THINK twice that the only advice Tamimi - Code

          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