Reading in XML and referencing and other questions

G

Guest

First let me say I am familar with programming, but not familiar with VB.net.

I am loading an existing XML document with this procedure

Dim xmlFile As String = "..\data\Products.xml"
Dim xmlDoc As XmlDocument

Private Sub Zadig_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim xmlTr As New XmlTextReader(xmlFile)

While xmlTr.Read
If xmlTr.Name = "id" AndAlso xmlTr.NodeType =
XmlNodeType.Element Then
cmbProducts.Items.Add(xmlTr.ReadString)
End If
End While
xmlTr.Close()

xmlDoc = New XmlDocument
xmlDoc.Load(xmlFile)

End Sub

If I have a NEW form (IE-Products.vb), will I be able to reference the XML
doc in Memory? Also, is there a good web reference that shows how to update
XML data (In memory) and then write them back out to a file?

Thanks,

Michael
 
G

Guest

I hope I am clear. Basically, I am wondering if I have to "reread" the file
into memory (in the new form) or since it was loaded before, that it will be
accessable to the new form.

Thanks,

Michael
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top