Solved

Processing XML Files

Posted on 2004-10-01
2
200 Views
Last Modified: 2010-04-15
I am developing a C# application that monitors a directory on a server for XML files.  These XML files are written to this directory through a separate application.  What my application needs to do is grab the XML file, parse it, insert the data into a database, and remove the file to separate location.  I am using the file system watcher class for listening to the files.  My question is what is the best way to read these XML files?  Should I read them into a dataset or is there another efficient way of doing it?   I am a novice .NET developer so any help will be appreciated.

Thanks
0
Comment
Question by:fifo123
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 96

Expert Comment

by:Bob Learned
ID: 12202040
Is the XML file structure simple?  Are they small, medium or large files?  If so, then using the DataSet.ReadXML is a very straight forward approach.

Bob
0
 
LVL 10

Accepted Solution

by:
ptmcomp earned 50 total points
ID: 12215480
Well, it depends how they should be stored in the database. If they are stored as text then it would be enough to just load them as text. Validating them whould be good to avoid garbage being written to the database... That can be done using an XmlValidatingReader and listening to the events.
XmlDocument would be easier and straight forward but it has more overhead. If there are few small files this is not relevant but if they are big you the way described before might be better...
0

Featured Post

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question