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. Need help on Xml

Need help on Xml

Scheduled Pinned Locked Moved ASP.NET
questionxmlhelpannouncementlearning
2 Posts 1 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.
  • H Offline
    H Offline
    hakanaktan
    wrote on last edited by
    #1

    How can i search a string in xml file inside elementStrings? Here is my xml file and i need to search and get matching values in ProductID and ProductName Elements: <?xml version="1.0" encoding="utf-8"?> < Products> < product> < ProductID>000001</ProductID> < ProductName>book</ProductName> </ product> < product> < ProductID>000002</ProductID> < ProductName>usb-memmory</ProductName> </ product> ... </ Products> Any article or piece of code would be nice.. Thanx.. ps:i tried xmlreader but i could not get matching ProductID and ProductName values from file:( --junior coder--

    H 1 Reply Last reply
    0
    • H hakanaktan

      How can i search a string in xml file inside elementStrings? Here is my xml file and i need to search and get matching values in ProductID and ProductName Elements: <?xml version="1.0" encoding="utf-8"?> < Products> < product> < ProductID>000001</ProductID> < ProductName>book</ProductName> </ product> < product> < ProductID>000002</ProductID> < ProductName>usb-memmory</ProductName> </ product> ... </ Products> Any article or piece of code would be nice.. Thanx.. ps:i tried xmlreader but i could not get matching ProductID and ProductName values from file:( --junior coder--

      H Offline
      H Offline
      hakanaktan
      wrote on last edited by
      #2

      I think it is faster than file operations.I use dataset to search a data my xml file.. Here is code (answer) for my previous question: Dim dt As DataTable Dim ds As New DataSet ds.ReadXml(Server.MapPath("myXmlFile.xml")) dt = CType(ds.Tables(0), DataTable) Dim counter As Integer For counter = 0 To dt.Rows.Count - 1 If dt.Rows(counter)(0).ToString = TextBox1.Text Then 'Do what if you want with this data Exit For ' Stop Searching if you found it End If Next --junior coder--

      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