Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Program to Write XML

Status
Not open for further replies.

serasmith

Programmer
May 4, 2006
2
IE
Hi there,

I am quite new to XML. I am attempting to write a program which takes information from a database and places it into an XML file. I have attempted this using VB in two different ways. Firstly, I simply used File System Objects to write the data - formating it through VB6. Then, I also did it using the DOM, appending each child etc. Both ways created the XML file perfectly. My problem is speed. Using FSO, it took 23.5 seconds, using DOM it took 24.5 seconds. The database will be growing continually so a more efficient method is required. Can anybody suggest if VB.net would be any quicker? Or if there is another method that I'm not aware of? Any help would be hugely appreciated.

Thanks,
Sera
 
How many records are in your database, and what is your database?

if it was in vb.net you could deserialise it easily enough, though whether it would be any quicker I couldnt comment.
 
At the moment, I'm returning about 600 Records, but that will grow substantially over time. I'm using Sybase Database and returning the info via Stored Procedures. I have to pull that data into a programming lauguage before sending it to XML as some modifications need to be made to that data
 
Right, for ease of use, I'd do this in .net (24 seconds for 600 records seems a long time)

Read in from SyBase to .Net (Ive no idea which driver, presumably odbc). this will all come in to the application in a dataset.

Manipulate the records in the dataset as you need to, then call dataSet.WriteXml

In fact, I'd consider not manipulating the data within the code (unless the manipulation is complex), export the data as an xml file, then use an xslt to make the modifications.

HtH
K
 
Just in case, I'd reconsider why do I need to export data to an XML file and if I can just handle the data in the database.

Cheers,
Dian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top