473,320 Members | 1,858 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Reading in XML and referencing and other questions

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
Jul 21 '05 #1
1 1192
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

"fremenusul" wrote:
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

Jul 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Yaro | last post by:
Hello DB2/NT 8.1.3 Sorry for stupid questions. I am newbe in DB2. 1. How can I read *.sql script (with table and function definitions) into a database? Tool, command... 2. In Project Center...
6
by: John E | last post by:
I have a question about how to make records in a table reference other records in the same table.... Suppose I'm building a small database to track some basic information on several companies....
10
by: aceto | last post by:
Hi. I'm sorry for my bad english, but it's not my motherlanguage. I need to read data from a webcam and display the images on DOS . So, how can i show this images? i have to translate the data...
6
by: Hans Kamp | last post by:
Is it possible to write a function like the following: string ReadURL(string URL) { .... } The purpose is that it reads the URL (determined by the parameter) and returns the string in which...
12
by: Mark Broadbent | last post by:
Hi guys, just going through remoting at the moment and a couple of questions relating to .net in general has surfaced. Firstly I have seen in the designer that for the namespace and many of its...
16
by: PromisedOyster | last post by:
Hi I have a situation where I want to use circular referencing. I have cut down the example for demonstration purposes. Say we have one executable (main.exe) and two DLLS (A1.dll and A2.dll)....
6
by: Mikey_Doc | last post by:
Hi We are running cms 2002, Framework 1.0 with Visual studio 2002. We have just upgraded to Framework 1.1 and visual studio 2003. All of our database connection strings are stored within the...
8
by: stewart_bristol | last post by:
can someone direct me to some compilable example code which reads in floating points or integers from a tab delimited file (either to variables or arrays) please? this is driving me mad today ...
4
by: lindabaldwin | last post by:
Hello all, I am fairly new to VBA and have had limited work with checkboxes before. I have turned an Excel worksheet into a form in which users can enter data and click checkboxes. I want to...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.