an ASP.NET Open Source CMS & eCommerce platform
Search:
Skip Navigation LinksHome > DotShoppingCart Forums > Support > Using DotShoppingCart > Adding A table to LINQ or use Query directly
Last Post 3/3/2010 2:14:45 PM By Bahram. 4 replies.
3/2/2010 3:25:57 PM
Bahram
Posts: 878
Joined: 12/8/2008
Location:Vancouver, BC Canada
Adding A table to LINQ or use Query directly
 How Can I add a table to the LINQ Data Source
1- I did a Copy of ManufactureList and ManufacturerProducts called ApplicationList and ApplicationProducts
2- I Added the two new blocks to DCS_Block_Type_lkp and map tables
 
My ApplicationList control works as a block, but I want to Link it to ApplicationProducts
 
Thsis is the Page load  event :
 
 protected void Page_Load(object sender, EventArgs e) {
...
           using (DSCComDataContext dc = DSCComDataContext.GetDataContext()) {
            application = dc.Applications.Single(m => m.ApplicationId == applicationId);

        }
       
I need to assign my query : All products of selected application. instead of the upper code
Application is my object instead of Manufacturer
 
 
 
3/2/2010 4:14:37 PM
lukezy
Posts: 2109
Joined: 6/12/2007
Location:WA, US
Re: Adding A table to LINQ or use Query directly
Search "add a table to the LINQ Data Source" in any of your favorate search engine.
DotShoppingCart Staff
3/3/2010 1:58:13 PM
Bahram
Posts: 878
Joined: 12/8/2008
Location:Vancouver, BC Canada
Re: Adding A table to LINQ or use Query directly
 Thanks for this very useful help. 
 
My Question is how can I add new Tablesto DSC  LINQ at : DotShoppingCart.Commercial.Core.DSCComDataSourceDataContext , It is readonly
3/3/2010 2:07:08 PM
lukezy
Posts: 2109
Joined: 6/12/2007
Location:WA, US
Re: Adding A table to LINQ or use Query directly
Feel free to remove readonly if that's the problem.
DotShoppingCart Staff
3/3/2010 2:14:45 PM
Bahram
Posts: 878
Joined: 12/8/2008
Location:Vancouver, BC Canada
Re: Adding A table to LINQ or use Query directly
 That is what I am asking :
 
If I add My statement :
 
Public Table<tablename> tablenames {get}
 
to the class then is that table accessible or more places needed to touch.
 
 
I also need to add a New List<Product>GetProducts( ......... ) with application as parameter instead of manufacturer.
 
Where is the source of GetProducts is that in Commercial Core Component?