| Author |
Create category programatically in .NET
|
|
|
| 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.
>
| |
|
| 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...
>
>
>
| |
|
| 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:
>
|
|
|
|