Re: Problem with Simplist.Add in C# - Commerce server
This is a discussion on Re: Problem with Simplist.Add in C# - Commerce server ; Tried the following and it seemed to work. Seems like you need to
create the com object using in non-interaop MSCS objects first and set
a typed reference to that new object and use that type reference to
build up ...
-
Re: Problem with Simplist.Add in C#
Tried the following and it seemed to work. Seems like you need to
create the com object using in non-interaop MSCS objects first and set
a typed reference to that new object and use that type reference to
build up the object. Then use the com reference for the Simplelist.Add
method.
object objNewDict = Server.CreateObject("Commerce.Dictionary")
Dictionary FreeItem = objNewDict as Dictionary;
FreeItem["_sku"] = "12345";
SimpleList FreeListItems = LineItem["orc_free_items"] as
SimpleList;
FreeListItems.Add(ref objNewDict);
If anyone knows a better way to do this or sees a problem with this
please post a reply.
Thanks...
-
Re: Problem with Simplist.Add in C#
The code you have is correct.
--------------------
From: "royhendrix@comcast.net" <royhendrix@comcast.net>
Newsgroups: microsoft.public.commerceserver.general
Subject: Re: Problem with Simplist.Add in C#
Date: 17 Oct 2005 10:32:47 -0700
Organization: http://groups.google.com
Lines: 19
Message-ID: <1129570367.286856.266460@g14g2000cwa.googlegroups.com>
References: <VfSdnVoZy5kNSc7eRVn_vQ@giganews.com>
NNTP-Posting-Host: 134.134.136.5
Mime-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
X-Trace: posting.google.com 1129570372 2780 127.0.0.1 (17 Oct 2005 17:32:52
GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Mon, 17 Oct 2005 17:32:52 +0000 (UTC)
In-Reply-To: <VfSdnVoZy5kNSc7eRVn_vQ@giganews.com>
User-Agent: G2/0.2
X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1;
..NET CLR 1.1.4322),gzip(gfe),gzip(gfe)
X-HTTP-Via: 1.0 jffwpr05.jf.intel.com:911 (squid/2.5.STABLE10)
Complaints-To: groups-abuse@google.com
Injection-Info: g14g2000cwa.googlegroups.com; posting-host=134.134.136.5;
posting-account=Q3KorAwAAAD0z1mEm9C1tlw2mM4E4raH
Path:
TK2MSFTNGXA01.phx.gbl!TK2MSFTFEED02.phx.gbl!tornado.fastwebnet.it!tiscali!ne
wsfeed1.ip.tiscali.net!proxad.net!216.239.36.134.MISMATCH!postnews.google.co
m!g14g2000cwa.googlegroups.com!not-for-mail
Xref: TK2MSFTNGXA01.phx.gbl microsoft.public.commerceserver.general:3685
X-Tomcat-NG: microsoft.public.commerceserver.general
Tried the following and it seemed to work. Seems like you need to
create the com object using in non-interaop MSCS objects first and set
a typed reference to that new object and use that type reference to
build up the object. Then use the com reference for the Simplelist.Add
method.
object objNewDict = Server.CreateObject("Commerce.Dictionary")
Dictionary FreeItem = objNewDict as Dictionary;
FreeItem["_sku"] = "12345";
SimpleList FreeListItems = LineItem["orc_free_items"] as
SimpleList;
FreeListItems.Add(ref objNewDict);
If anyone knows a better way to do this or sees a problem with this
please post a reply.
Thanks...
--
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
Note: For the benefit of the community-at-large, all responses to this
message are best directed to the newsgroup/thread from which they
originated.
Similar Threads
-
By Application Development in forum labview
Replies: 0
Last Post: 11-02-2007, 10:40 AM
-
By Application Development in forum DOTNET
Replies: 2
Last Post: 04-02-2007, 10:43 AM
-
By Application Development in forum Graphics
Replies: 4
Last Post: 10-24-2006, 08:35 PM
-
By Application Development in forum DOTNET
Replies: 0
Last Post: 10-19-2005, 02:43 AM
-
By Application Development in forum Hardware
Replies: 0
Last Post: 07-05-2004, 07:55 AM