VB.Net and XML

  • Thread starter Thread starter Brian
  • Start date Start date
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
 
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
 
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
 
Hi Brian,

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

Cor
 
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
 
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
 
* "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!
 
Back
Top