VB.Net and XML

B

Brian

Hello:

I am making an App in VB.Net which prints forms for
companies. I want to use an XML file to store a list of
forms and their group information and so on. Every time I
load this app, I want to load this information into a
Dataset.

My question is...I have included this XML file into
solution, How do I load it into the dataset?? For some
reason, I cant figure out how to load the xml file because
I have included it into my solution. I want to include it
because it will save support headaches. Is this
possible???? Please help


Thanks in advance and Merry Christmas

Brian
 
C

Cor

Hi Brian,

First you have to look if it fulfil things to be a datset.

That you can do opening the XML file in the designer and than rightclick on
it and tell to generate a XSD.

If that is posible than it is easy using the

dataset.readXML(path)

I hope this helps,

And Merry Chrismass also.

Cor
 
B

Brian

Thanks for the Reply:

Unfortunately that wont work cause I cannot set the path
to the xml file because it is included in the solution.
How would I get path to an xml file that is included in
the solution???


Brian
 
C

Cor

Hi Brian,

If it is config for your program, than the same directory as your program is
very normal I think.

Cor
 
K

Ken Tucker [MVP]

Hi,

This will get the directory the program is in.
Dim path As String

path = System.IO.Path.GetDirectoryName( _

System.Reflection.Assembly.GetExecutingAssembly.Location)

Ken
 
B

Brian

The XML file will not be on the hard drive anywhere. I am
building it into the dll. I have already built a dataset
for it to be read into. I just cant figure out how to get
the xml data from my dll. I dont want to store the xml
file anywhere where our clients can touch it cause we have
some experimental and will screw it up. So that is why I
want to store it internally in the dll. I just dont know
how to get the data back out.

Thanks again

Brian
 
H

Herfried K. Wagner [MVP]

* "Cor said:
If that is posible than it is easy using the

dataset.readXML(path)

.... reminds me of Java... (the camel case).

SCNR

Merry Christmas!
 

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