Data import advice
 
Home My Account Forum Try It! Buy It!
About Contact Us Site Map
StrataFrame Forum
Home      Members   Calendar   Who's On
Welcome Guest ( Login | Register )
      



Data import adviceExpand / Collapse
Author
Message
Posted 02/04/2008 2:31:36 PM


StrataFrame Novice

StrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame NoviceStrataFrame Novice

Group: Forum Members
Last Login: 06/19/2008 11:16:33 AM
Posts: 73, Visits: 12,471
I'm writing a new application and I want to populate the database with legacy data using XML files.  So, the steps are as follows:  1) extract data from existing system, 2) create XML files, 3) import data from XML files then populate the bo's and call the save methods (which in turn runs all of the data through the validations).

The question involves this concept:  a Company can have many Products.  The XML file contains a denormalized list of company / product names ... consider for a moment that the first company has ten products ... the first round of importing adds one new record to the company table and ten new records to the Product table.  I then save using a transaction.  If nothing fails validation, the bo's should be set to IsDirty = false and ready for the next set of Company/Product pairs to be imported ... round two ... the next company is added which has 15 products.  I add a new record to the company bo and 15 new records to the product bo.  The company bo now has two records, one is saved to the db the other is not.  The product bo now has 25 records, ten which have been saved to the db ... 15 have not. 

My question is this:  When I call the boProduct.Save() method (automatically saving the parent, boCompany, as they are in a parent child relationship) ... both bo's ignore the information in the rows that have already been saved ... correct?  I believe this to be the case but I want to make sure first.   

My second question:  Should I call an initialize method to clear out the current data table prior to cycling the next Company / Product set through the import process?  Assuming there are thousands of companies and tens of thousands of products, it is possible the current data table could have tons of unneeded data in them at the end of the process if I don't.

Thanks everyone,

CT

Post #13986
« Prev Topic | Next Topic »


Reading This TopicExpand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: Ben Chase, Trent L. Taylor, Steve L. Taylor

PermissionsExpand / Collapse

All times are GMT -6:00, Time now is 10:25am

Powered By InstantForum.NET v4.1.4 © 2008
Execution: 0.047. 11 queries. Compression Enabled.
Site Map - Home - My Account - Forum - About Us - Contact Us - Try It - Buy It

Microsoft, Visual Studio, and the Visual Studio logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries.