Is this correct? can anyone explain whats happening?is it correctly done?
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
'Creates document outline
Const strFileName As String = "c:/Beyonder/XMLExample.xml"
Dim objXmlTW As XmlTextWriter = New XmlTextWriter(strFileName, Encoding.UTF8)
'Sets the indentation for the XML file
objXmlTW.Formatting = Formatting.Indented
objXmlTW.Indentation = 4
Dim rs
If Not rs.eof Then
objXmlTW.WriteStartElement("document")
While Not rs.eof
For Each field In rs.fields
objXmlTW.WriteElementString(field.name, field.value)
Next
rs.movenext()
End While
End If
rs.close()
'Write root element
'objXmlTW.WriteStartElement("document")
'objXmlTW.WriteElementString("Name", editName.Text)
'objXmlTW.WriteElementString("Address", editAddress.Text)
'objXmlTW.WriteElementString("Telephone", editTelephone_Number.Text)
'objXmlTW.WriteFullEndElement()
'Write to the file and close
'objXmlTW.Flush()
'objXmlTW.Close()
TextBox1.Text = TextBox1.Text + ReadDocument(strFileName)
End Sub
|