How do I sequentially process multiple XML files in a directory?

T

TofuTheGreat

I've just started with VB.Net so forgive my lack of knowledge.

I've got a directory that's populated with XML files. I need to create
a VB.Net (2003) application that allows the user to choose the
directory to process and would automatically open each XML file to be
parsed into a table in a dataset.

I've been able to create a version that allows the user to select a
specific file (using the OpenFileDialog) but I want them to be able to
choose a directory and then automatically open, and parse, every file
in the directory.

Any tips or pointers to examples that I can use?
 
H

Herfried K. Wagner [MVP]

I've got a directory that's populated with XML files. I need to create
a VB.Net (2003) application that allows the user to choose the
directory to process and would automatically open each XML file to be
parsed into a table in a dataset.

I've been able to create a version that allows the user to select a
specific file (using the OpenFileDialog) but I want them to be able to
choose a directory and then automatically open, and parse, every file
in the directory.

Displaying the dialog for choosing a directory
<URL:http://dotnet.mvps.org/dotnet/faqs/?id=folderbrowserdialog&lang=en>

+ 'System.IO.Directory.GetFiles'.
 
C

Cor Ligthert [MVP]

Herfried,

This text is in my opinion wrong on your page, I have set it in the way as
it in my opinion has to be.

Not for Net 1.0

http://msdn.microsoft.com/library/e...WindowsFormsFolderBrowserDialogClassTopic.asp

Note that there is a bug in the .NET Framework 1.1, that is solved in SP1.
Withouth the SP1 can that causes a really bad error when using a path
longer than about 128 characters. This occurs on
Unicode systems only.

For the OP as well of course,

Cor
 
H

Herfried K. Wagner [MVP]

Cor Ligthert said:
This text is in my opinion wrong on your page, I have set it in the way as
it in my opinion has to be.

Not for Net 1.0

http://msdn.microsoft.com/library/e...WindowsFormsFolderBrowserDialogClassTopic.asp

Note that there is a bug in the .NET Framework 1.1, that is solved in SP1.
Withouth the SP1 can that causes a really bad error when using a path
longer than about 128 characters. This occurs on
Unicode systems only.

Mhm... The article explicitly states:

| To avoid this problem, obtain the hotfix, use the p/invoke solutions
listed
| below, or .NET 1.1 SP1:
 
C

Cor Ligthert [MVP]

Herfried,
| To avoid this problem, obtain the hotfix, use the p/invoke solutions
listed
| below, or .NET 1.1 SP1:

Why would I use Win32 solutions or a hotfix if there is a complete good
working Net solution? This text in the last case the SP1. Why something
wrong with it?

Hotfixes are meant to overcome problems temporaly until there is an SP.

In my opinion is that text a little bit misleading.

But feel free to do it as you want.

Cor
 
H

Herfried K. Wagner [MVP]

Cor Ligthert said:
This text is in my opinion wrong on your page, I have set it in the way as
it in my opinion has to be.

Although the text is not wrong, I have restructured it to reflect that .NET
1.1 SP1 is already available for some time now... The change will be
visible if I update the site the text time. Thanks for making me aware of
the potential problem.
 

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