I have created some queries to append new products into dbo_ac_Products from my SQL Server products database. When I append new products, it seems to crash the database, although it seems as if I am not violating any keys when I do the append.
Once the products are appended, I also append this product info to dbo_ac_CatalogNodes, using the product id generated in dbo_ac_Products.
Is there some sort of rebuild routine that should be run after appending these products so that the database does not crash after appending? I always back the database up before appending so I can restore it, but it seems to me this must be possible to append records successfully.
I know that there is the DataPort to append info, but I don't really want to use that selection because it requires me to produce an XML file with all the new products, export that to a flat file and then open DataPort to transfer the information. I am really looking for a seemless operation that can be handled via SQL Server Agent, as much of my other web marketing is automated. It seems that if it can be done via DataPort, it should be able to be done via append queries, as long as I follow the same protocol in DataPort. Any help you can give would be appreciated. Thanks!
Using SQL Server to Append New Products to AbleCommerce
-
- Commander (CMDR)
- Posts: 118
- Joined: Sat Dec 20, 2008 11:27 pm
Re: Using SQL Server to Append New Products to AbleCommerce
Safer and easier to use code/CommerceBuilder objects to add products:
Also better for automation, as you can expose your code as a web method.
Code: Select all
Product myProduct = new Product();
myProduct.Name = importedName;
... etc
myProduct.Save()
Nick Cole
http://www.ethofy.com
http://www.ethofy.com
- jmestep
- AbleCommerce Angel
- Posts: 8164
- Joined: Sun Feb 29, 2004 8:04 pm
- Location: Dayton, OH
- Contact:
Re: Using SQL Server to Append New Products to AbleCommerce
The dataport doesn't require you to use an xml file if you are wanting to add products without options, etc. You can use a csv and put in the categories you want, then everything is added to the database where it should be.
Judy Estep
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx
Web Developer
jestep@web2market.com
http://www.web2market.com
708-653-3100 x209
New search report plugin for business intelligence:
http://www.web2market.com/Search-Report ... -P154.aspx
-
- Commander (CMDR)
- Posts: 118
- Joined: Sat Dec 20, 2008 11:27 pm
Re: Using SQL Server to Append New Products to AbleCommerce
How do we access Code Builder? I just installed AbleCommerce and am still learning how the various modules are set up.
Re: Using SQL Server to Append New Products to AbleCommerce
You just need to import the appropriate namespace into your code and classes in that namespace will be made available to you. For example if you want to use the Product object then first you will need to add an import statement for CommerceBuilder.Products namespace. Have a look at some conlib control for sample, for example check the ConLib/Basket.ascx.cs control code file.
Also please have a look at this, it may help you
http://wiki.ablecommerce.com/index.php/ ... uilder_API
Also please have a look at this, it may help you
http://wiki.ablecommerce.com/index.php/ ... uilder_API