an ASP.NET Open Source CMS & eCommerce platform
Search:
Skip Navigation LinksHome > DotShoppingCart Forums > Development > General Programming > How to add a new table and integrate it within ...
Last Post 12/17/2009 9:38:17 AM By lukezy. 1 replies.
12/17/2009 9:08:20 AM
Applied
Posts: 93
Joined: 9/18/2009
How to add a new table and integrate it within DSC
I want to add a new table (e.g. for product volume discounts). I would like to be able to access the new table as part of the object model. I would also like the admin editor to be able to pick up the new table for user input purposes.
 
What needs to be changed to recognise the new table?
 
I can add 'whatever.cs' to the 'Core' project. Do I then add an entry into 'DSCCom.dbml'? What else?
 
I think I can use:
 
DSCComDataContext dc = DSCComDataContext.GetDataContext();
 
to get access to the database say for a query, but I noticed another user used something like:
 
DiscountsDataContext db =
new DiscountsDataContext(ConfigurationController.SiteConfigurationController.GetSiteConnectionString(SiteNavigation.GetHost()));
 
Is the best way forward something like that and can you provide a brief example?
 
Thanks.
 
 
 

 

 

 

12/17/2009 9:38:17 AM
lukezy
Posts: 2109
Joined: 6/12/2007
Location:WA, US
Re: How to add a new table and integrate it within DSC
Product volume discount is the feature implemented in V4. You might to want to migrate to V4.
 
You can use LinqToSql. After you input the table to DSCCom.dbml you can use the following code.
 
            using (DSCComDataContext dc = DSCComDataContext.GetDataContext()) {
                // do something with dc.MyNewTables
                dc.SubmitChanges();
            }
DotShoppingCart Staff