Using existing data from another database

Topics: Developer Forum
Oct 7, 2008 at 5:38 AM
Hi

Is it possible to import existing data from another database as a ContentItem?
For example, if I have a database named 'Database2' with a Products table containing 100 products - Could I create the Product model manually by inheriting from the ContentItem class and adding the required properties etc, and then (somehow) tell the Persister to load all Product items from Database2?

Thanks
Matthew
Coordinator
Oct 7, 2008 at 8:59 PM
You have a few options. One is creating one node and have it return items representing the products in database2 from an override of the GetChildren() method. If you want to manipulate the products you can have the product items implement IActiveContent. You can look at the directory implementation for reference.
Oct 7, 2008 at 9:23 PM
Thanks - I'll try this soon.