Commerce Server Catalog - Create category programatically in .NET

This is Interesting: Free IT Magazines  
Home > Archive > Commerce Server Catalog > June 2005 > Create category programatically in .NET





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Create category programatically in .NET
cbuda

2005-06-23, 5:55 pm

I am converting an MSCS site to .NET and have to convert some code that
allows users to create new categories on the fly. I assume I need to use
Interop.Catalog and I have successfully created a category that way but am at
a loss regarding how to set the value of the name of the category. The
ProductCatalog.CreateCategory call does not take Name as a parm and when I
try to use GetCategoryProperties and SetCategoryProperties I get an error
regarding the use of the ADODb resultset : "Option Strict On disallows
implicit conversions from 'ADODB.Recordset' to 'ADODB._Recordset'." This
error comes when I try to pass the Recordset from GetCategoryProperties to
the SetCategoryProperties call. Thanks in advance.

Zoe Hart [MVP]

2005-06-23, 5:55 pm

The ProductCatalog.CreateCategory method has two required parameters,
strDefinitionName and strCategoryName, and two optional parameters,
strParentCategoryName and fIsSpecificationSearchable. The strCategoryName
parameter should be how you set the category name.

--
Zoe Hart
Commerce Server MVP

"cbuda" <cbuda@discussions.microsoft.com> wrote in message
news:B07046A8-1DCB-461F-9DD0-7951F4B6DE12@microsoft.com...
>I am converting an MSCS site to .NET and have to convert some code that
> allows users to create new categories on the fly. I assume I need to use
> Interop.Catalog and I have successfully created a category that way but am
> at
> a loss regarding how to set the value of the name of the category. The
> ProductCatalog.CreateCategory call does not take Name as a parm and when I
> try to use GetCategoryProperties and SetCategoryProperties I get an error
> regarding the use of the ADODb resultset : "Option Strict On disallows
> implicit conversions from 'ADODB.Recordset' to 'ADODB._Recordset'." This
> error comes when I try to pass the Recordset from GetCategoryProperties to
> the SetCategoryProperties call. Thanks in advance.
>



cbuda

2005-06-23, 5:55 pm

Sorry. my mistake. I meant to say that it does not allow you to set the
Description. I am able to set the name properly. Any idea how to populate
the Description?

Thanks

"Zoe Hart [MVP]" wrote:

> The ProductCatalog.CreateCategory method has two required parameters,
> strDefinitionName and strCategoryName, and two optional parameters,
> strParentCategoryName and fIsSpecificationSearchable. The strCategoryName
> parameter should be how you set the category name.
>
> --
> Zoe Hart
> Commerce Server MVP
>
> "cbuda" <cbuda@discussions.microsoft.com> wrote in message
> news:B07046A8-1DCB-461F-9DD0-7951F4B6DE12@microsoft.com...
>
>
>

cbuda

2005-06-24, 5:54 pm

I found a resolution and that was that I got it to work in C# but not VB.Net.
I used the GetCategotyProperties/SetCategoryProperties calls and set the
"Description" in the resultset to the proper value

Thanks

"cbuda" wrote:
[vbcol=seagreen]
> Sorry. my mistake. I meant to say that it does not allow you to set the
> Description. I am able to set the name properly. Any idea how to populate
> the Description?
>
> Thanks
>
> "Zoe Hart [MVP]" wrote:
>
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com