it is really nice but i am still facing problem with it :(
public static CatalogItemsDataSet SearchCatalog(CatalogContext context, string catalogName){ // Search the catalog. // Create the search options. CatalogSearchOptions searchOptions = new CatalogSearchOptions(); searchOptions.PropertiesToReturn = "CategoryName, DefinitionName, i_classtype, ProductId, VariantId, DisplayName"; searchOptions.SetPaging(1, 20); searchOptions.SortProperty = "CategoryName"; CatalogSearch catalogSearch = context.GetCatalogSearch(); // Specify the catalogs to search. // This is a comma-separated list of catalogs to search, // for example, "Catalog1,catalog2". catalogSearch.CatalogNames = catalogName; // Specify the categories to search. All categories that match the // expression are searched. This example searches all categories // that have "technical" as part of their descriptions. catalogSearch.CateoriesClause = @"Description like '%technical%'"; // Return all items with price less than $10.00. catalogSearch.SqlWhereClause = "cy_list_price<10"; // Also use the free-text search. catalogSearch.UseAdvancedFreeTextSearch = true; // Return all rows that contain the phrase "sql books". catalogSearch.AdvancedFreeTextSearchPhrase = "\"sql books\""; catalogSearch.SearchOptions = searchOptions; // Perform the search. int totalRecords = 0; CatalogItemsDataSet catalogItems = catalogSearch.Search(out totalRecords); Console.WriteLine(totalRecords); // Access each of the returned items. foreach (CatalogItemsDataSet.CatalogItem catalogItem in catalogItems.CatalogItems) { Console.WriteLine(catalogItem.CategoryName); Console.WriteLine(catalogItem.DisplayName); } return catalogItems;}
http://blogs.msdn.com/nikhiln/default.aspx
http://blogs.msdn.com/rdonovan/
http://blogs.msdn.com/vinayakt/archive/2004/05/08/128366.aspx
http://msdn2.microsoft.com/en-us/library/aa546103.aspx
http://blogs.msdn.com/vinayakt/archive/2004/05/13/130972.aspx
No comments:
Post a Comment