10-07-04 12:47 PM
Protected _catalog As ProductCatalog
_catalog = CommerceContext.Current.CatalogSystem.GetCatalog("All Virtual")
Dim ds As DataSet = _catalog.GetRootCategories()
Dim dv As New DataView(ds.Tables(0))
dv.RowFilter = "OrigCategoryName='" &
Request.QueryString("displayName") & "'"
Dim ds1 As DataSet
Dim totDS As New DataSet()
Dim im As Int16
If dv.Count > 0 Then
For im = 0 To dv.Count - 1
Dim myCat As ProductCatalog =
CommerceContext.Current.CatalogSystem.GetCatalog(dv.Item(im)("BaseCatalogNam
e").ToString)
Try
ds1 =
myCat.GetCategory(dv.Item(im)(2).ToString).GetProducts(Nothing, True)
totDS.Merge(ds1, True)
Catch ex As Catalog.CategoryNotFoundException
End Try
Next
End If
designsDataSet = totDS
----------------------------------------------------------------------------
------------------
This code works and I can get all the products for Parent Categories (Like
Animals) but not for Birds which is sub category witin one of the CATALOGS o
f
the Virtual Catalog.
Will this help you find me solution??
Thanks
TechMate
""Vinayak Tadas[MSFT]"" wrote:
> Can you post your code snippet?
>
> --------------------
> Thread-Topic: How do I get products of a sub category from Virtual Catalog
s
> thread-index: AcSr7pRwlOkYnEWyRn2u3rBjyRwEZA==
> X-WBNR-Posting-Host: 68.21.210.2
> From: "examnotes" <TechMate@discussions.microsoft.com>
> Subject: How do I get products of a sub category from Virtual Catalogs
> Date: Wed, 6 Oct 2004 14:51:05 -0700
> Lines: 10
> Message-ID: <4DC2D473-A949-421B-BEE0-DD1B5CB15F55@microsoft.com>
> MIME-Version: 1.0
> Content-Type: text/plain;
> charset="Utf-8"
> Content-Transfer-Encoding: 7bit
> X-Newsreader: Microsoft CDO for Windows 2000
> Content-Class: urn:content-classes:message
> Importance: normal
> Priority: normal
> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
> Newsgroups: microsoft.public.commerceserver.catalog
> NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
> Path: cpmsftngxa06.phx.gbl!TK2MSFTNGXA03.phx.gbl
> Xref: cpmsftngxa06.phx.gbl microsoft.public.commerceserver.catalog:5011
> X-Tomcat-NG: microsoft.public.commerceserver.catalog
>
> I have two base catalogs C1 and C2. Each of them have Animals Parent
> category
> and Birds, Fish ... Subcategories within the Animals category. I created a
> virtual Catalog and included both C1 and C2 catalogs (without
> inclusion/exclusion rules). When I try to get the products for Animals I
> get
> the entire set of records but when I try to get products from one of the
> sub
> categories, I dont get any records. How do i get to work with the virtual
> catalog in this case.
>
> any help will be of great help to me as I am new to Commerce Server and i
> read books and tried all blogs and discussion groups
>
>
> Thanks
> Vinayak Tadas
> Microsoft
> http://blogs.msdn.com/vinayakt
>
> This posting is provided "AS IS" with no warranties, and confers no rights
.
> You assume all risk for your use. © 2002 Microsoft Corporation. All right
s
> reserved.
> Use of included script samples are subject to the terms specified at
> http://www.microsoft.com/info/cpyright.htm
> Get Secure! For more info visit http://www.microsoft.com/security. Pleas
e
> reply to the newsgroups only
[ Post a follow-up to this message ]
|