Hi All
I'm trying to write a VB.net script that will parse an AWIN XML file and insert its contents into a MySQL Products database. I
am learning about XmlReader and XmlTextReader. So far, I have the code below, which will successfully display the contents of the xml file in the browser. However, I
am a long way from getting it to insert into the database.
Any example scripts out there?
For a given <product></product> how do I retrieve the various tag values and put them into an SQL statement?
Do I add a SQL INSERT statement within the below loop?
Any comments and guidance appreciated.
Many thanks
Accelerator
__
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) _
Handles Me.Load
Dim reader As XmlTextReader = New XmlTextReader(Server.MapPath("smartav.xml"))
'reads the first node, which is <?xml version="1.0" encoding="UTF-8"?>. We do not want to print this line; therefore, we will read it outside the loop and do nothing.
reader.Read()
While (reader.Read())
Response.Write(reader.Value)
Response.Write("<br />")
End While
End Sub
__