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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Database & SysAdmin
  3. Database
  4. comparing data in SQL with an XML file [modified]

comparing data in SQL with an XML file [modified]

Scheduled Pinned Locked Moved Database
databasexmlquestion
2 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.
  • O Offline
    O Offline
    ONeil Tomlinson
    wrote on last edited by
    #1

    HI I have a table (ContactDetails) with 2000 records. I have an application receiving an XML file from an external web service. Most time the data received from the web service is similar to the data in my table. Occasionally the data returned from the web service will have few differences. I want to compare the data received from the web service with the data in my local database and generate a xml file (based on the same schema) to send to another application . So how do i go about doing that? Thanks

    modified on Thursday, August 28, 2008 12:13 PM

    D 1 Reply Last reply
    0
    • O ONeil Tomlinson

      HI I have a table (ContactDetails) with 2000 records. I have an application receiving an XML file from an external web service. Most time the data received from the web service is similar to the data in my table. Occasionally the data returned from the web service will have few differences. I want to compare the data received from the web service with the data in my local database and generate a xml file (based on the same schema) to send to another application . So how do i go about doing that? Thanks

      modified on Thursday, August 28, 2008 12:13 PM

      D Offline
      D Offline
      David Mujica
      wrote on last edited by
      #2

      I would approach this problem by breaking it down into phases. 1) Read the XML file 2) Fetch data from the database and compare to XML data 3) Write a resulting XML file Below should get you some idea how to loop through an XML file. Imports System.Xml Dim xdTemplate As New XmlDocument Dim xnRoot As XmlNode xdTemplate.Load("c:\temp\FP_TAK.xml") xnRoot = xdTemplate.SelectSingleNode("/myPath/mySub/etc") ' This code show some simple code to loop through an XML file ' you will need to modify this based on your layout, but at least it shows some ' functionality. While (Not (IsNothing(xnRoot)) If (xnRoot.Name = "FSFORMULATPALL") Then If (xnRoot.Item("PARAM_CODE").InnerText = "R.B.D_SOY_ALLERGEN") Then Debug.Print(CStr(i) + ") " + xnRoot.Item("PARAM_CODE").InnerText) xnRoot.Item("PVALUE_LABEL").InnerText = "No" End If End If xnRoot = xnRoot.NextSibling End While xdTemplate.Save("c:\temp\dave.xml")

      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