Newbie design advice

  • Thread starter Thread starter larzeb
  • Start date Start date
L

larzeb

I have already written a process to input a list of addresses in XML
format, create Address objects from the XML data, pass off each
Address object to a COM object for data cleansing and validation, and
finally write the object to a SQL database.

My implementation probably was drawn from my procedural days:

Read a single XML record
Create Address object from XML record
Clean individual Address object via COM object
Insert record into DB, insuring for no dups

This process is done repetively until EOF on the XML file. But I
wonder if it would be more efficient to do the proccess stepwise as
above, completing each step before proceeding by creating an array of
objects and passing them off to the next step? I'm sure the entire
process would be more encapsulated than it is now.

If that is the better approach, I'm concerned about memory
utilization. The program is written in WinForms. A single batch of
addresses may contain 10-15K records.

I would appreciate any adivce. TIA
 
Hi larzeb,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that you need to know the best practice for
adding the xml records to DB server. If there is any misunderstanding,
please feel free to let me know.

I think adding the records to the DB at a time will be faster. When reading
records from Xml, we can use XmlTextReader. It is much faster than using
XmlDocument for parsing the Xml file. After reading each single record, we
can add it to a DataSet and then use a DataAdapter to update to the DB.

HTH.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."
 
Back
Top