Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

.NET 

Inserting from xml to datebase in vb

I have xml that looks like this

Code
<?xml version="1.0" standalone="yes"?>
<sdnList xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://tempuri.org/sdnList.xsd">
  <sdnEntry>
    <uid>36</uid>
    <lastName>AEROCARIBBEAN AIRLINES</lastName>
    <sdnType>Entity</sdnType>
    <programList>
      <program>CUBA</program>
    </programList>
    <akaList>
      <aka>
        <uid>12</uid>
        <type>a.k.a.</type>
        <category>strong</category>
        <lastName>AERO-CARIBBEAN</lastName>
      </aka>
    </akaList>
    <addressList>
      <address>
        <uid>25</uid>
        <city>Havana</city>
        <country>Cuba</country>
      </address>
    </addressList>
  </sdnEntry>

And the code that i am using to insert starts like this

Code
node_list = xml_doc.SelectNodes("//sdnEntry")
        For Each node In node_list
            If CheckElement("lastName", node) <> "" Then
                sql = "INSERT INTO us_sdnentry (uid_,lastname,sdntype) VALUES "
                sql &= "('" & node.SelectNodes("./uid").Item(0).InnerText & "','" & CheckElement("lastName", node) & "','" & node.SelectNodes("./sdnType").Item(0).InnerText & "'")"
                db_sql.RunSql(sql)
            End If
            sql = ""
            '
            '
            '

The problem is that when i am debugging and my program executes it just skips the foreach, it dont go inside...
From my 101 XML/JSON : https://hackforums.net/showthread.php?tid=5353651

[Image: Ieci4qm.jpg]

Result:

[Image: 338vFcN.jpg]

Table definitions:

[Image: HxglNPZ.jpg]

Edited:

If you want to save your aka members just:

PHP Code

<?php 
param
(0).Value = myData.sdnEntry.akaList.aka.uid
param
(1).Value = myData.sdnEntry.akaList.aka.lastName
param
(2).Value = myData.sdnEntry.akaList.aka.type 

First they ignore you, then they laugh at you, then they fight you, and then you win.


Possibly Related Threads...
Thread / Author Replies Views Last Post
[C#] by Elite Hacker 69Dec 4, 2016 08:46 PM 11 181 Dec 4, 2016 08:46 PM
Last Post: Elite Hacker 69
[Python] by datguy.devSep 16, 2016 11:34 AM 2 78 Sep 16, 2016 11:34 AM
Last Post: datguy.dev
[.NET] by offpageseoAug 25, 2016 08:49 AM 3 137 Aug 25, 2016 08:49 AM
Last Post: Elitas