Groups | Blog | Home
all groups > dotnet xml > october 2005 >

dotnet xml : New ti xml database


Jim Bob
10/13/2005 3:16:05 PM
I need to use a file that is in xml format in vb.net.

I'm new here. I have MSSql 2000 and vb.net 2003. I have accessed SQL
files before. What is best.
1. Access the XML file directly?

2. Somehow import it into MSSQL 2000

3. Is there a better way.

The file is publically available via internet. It must be updated
periodically and accessed.

Any Good advice will be greatly appreciated.


jwc

Pascal Schmitt
10/14/2005 12:00:00 AM
[quoted text, click to view]

There are multiple ways. If it is a small file and you don't need
highest performance but understandable code, use System.Xml.XmlDocument
wich provides an XML DOM wich means that the whole XML document will be
converted into a tree of objects (thus it won't work with large
documents and will be slow and oversized if you don't use all the data).
Then there is System.Xml.XPath.XPathDocument wich is a bit "lighter"
than XmlDocument and allows you to do queries using XPath, for example
from XSLT.
The fastest way, wich is also suitable for very large documents is the
use of System.Xml.Xml(Text)Reader/Writer. The reader is just a simple
parser wich allows you to navigate from one node to the next and
determine its type, name, namespace and value. The writer directly
writes XML tokens, it helps you with namespaces, indentation and has a
few comfort-methods for writing special content. It is also easy to
"stream-process" (large) XML files with those two classes.


--
AddThis Social Bookmark Button