Commerce Server General - HELP: What is wrong with this CODE !!!

This is Interesting: Free IT Magazines  
Home > Archive > Commerce Server General > October 2004 > HELP: What is wrong with this CODE !!!





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 HELP: What is wrong with this CODE !!!
Ravi Shankar

2004-09-04, 2:46 am

bit of a bind over this.

(i've included the mscscorelib.dll and Commerce 1.0
object) as com references into the project

Imports Microsoft.CommerceServer.Interop
Imports Microsoft.CommerceServer.RunTime
Imports Microsoft.CommerceServer.RunTime.Configuration

Dim oCouponGroup As New Dictionary
Dim oCouponCollection As New
System.Collections.Specialized.HybridDictionary
Dim gOrderGroupID As Guid
Dim sOrderGroupID As String
Dim sUserID As String = "{0D93ED9A-1837-4FD6-8966-
D635FB011DC6}"

oDBStorage = New
Microsoft.CommerceServer.Interop.Orders.DBStorage
oDBStorage.InitStorage(oTransactionResource.Item
("connstr_db_transactions"), "CouponGroup", "coupongroup_i
d
user_id", "Commerce.Dictionary", "marshaled_data", "d_Date
LastChanged")

gOrderGroupID = System.Guid.NewGuid()
oCouponGroup.Value("coupongroup_id") =
gOrderGroupID.ToString()

oCouponGroup.Value("user_id") = sUserID
oCouponGroup.Value("coupon_collection") =
oCouponCollection

oCouponGroup.Value("total_coupons") =
oCouponCollection.Count

oDBStorage.InsertData(vbNull, CType(oCouponGroup, Object))

But it fails at this call with an error of
type 'System.Runtime.InteropServices.COMException' that
says "Type Mismatch"

What am I missing in this ?
Regards.
Vinod Kumar[MSFT]

2004-09-23, 5:51 pm

Change the last line as follows

oDBStorage.InsertData(DBNull.Value, CType(oCouponGroup, Object))


Thanks
-Vinod

This posting is provided "AS IS" with no warranties, and confers no rights.

EBusiness Server Team
--------------------
Content-Class: urn:content-classes:message
From: "Ravi Shankar" <shankar.nospam@hp.com>
Sender: "Ravi Shankar" <shankar.nospam@hp.com>
Subject: HELP: What is wrong with this CODE !!!
Date: Sat, 4 Sep 2004 01:16:47 -0700
Lines: 44
Message-ID: <5e2a01c49257$85cb9be0$a501280a@phx.gbl>
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
thread-index: AcSSV4XLaQ9sO2mcSl+kV0U6t7caSA==
Newsgroups: microsoft.public.commerceserver.general
Path: cpmsftngxa10.phx.gbl
Xref: cpmsftngxa10.phx.gbl microsoft.public.commerceserver.general:14705
NNTP-Posting-Host: tk2msftngxa13.phx.gbl 10.40.1.165
X-Tomcat-NG: microsoft.public.commerceserver.general

bit of a bind over this.

(i've included the mscscorelib.dll and Commerce 1.0
object) as com references into the project

Imports Microsoft.CommerceServer.Interop
Imports Microsoft.CommerceServer.RunTime
Imports Microsoft.CommerceServer.RunTime.Configuration

Dim oCouponGroup As New Dictionary
Dim oCouponCollection As New
System.Collections.Specialized.HybridDictionary
Dim gOrderGroupID As Guid
Dim sOrderGroupID As String
Dim sUserID As String = "{0D93ED9A-1837-4FD6-8966-
D635FB011DC6}"

oDBStorage = New
Microsoft.CommerceServer.Interop.Orders.DBStorage
oDBStorage.InitStorage(oTransactionResource.Item
("connstr_db_transactions"), "CouponGroup", "coupongroup_i
d
user_id", "Commerce.Dictionary", "marshaled_data", "d_Date
LastChanged")

gOrderGroupID = System.Guid.NewGuid()
oCouponGroup.Value("coupongroup_id") =
gOrderGroupID.ToString()

oCouponGroup.Value("user_id") = sUserID
oCouponGroup.Value("coupon_collection") =
oCouponCollection

oCouponGroup.Value("total_coupons") =
oCouponCollection.Count

oDBStorage.InsertData(vbNull, CType(oCouponGroup, Object))

But it fails at this call with an error of
type 'System.Runtime.InteropServices.COMException' that
says "Type Mismatch"

What am I missing in this ?
Regards.

Ravi Shankar

2004-09-24, 2:48 am

Nope ! Still the same error

The table structure is as follows

'CREATE TABLE [CouponGroup] (
' [coupongroup_id] [uniqueidentifier] NOT NULL ,
' [user_id] [uniqueidentifier] NOT NULL ,
' [total_coupons] [int] NOT NULL CONSTRAINT
[DF_CouponGroup_total_coupons] DEFAULT (0),
' [marshaled_data] [image] NULL ,
' [g_UserIdChangedBy] [uniqueidentifier] NULL ,
' [d_DateLastChanged] [datetime] NULL ,
' [d_DateCreated] [datetime] NULL
') ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
' GO()


>-----Original Message-----
>Change the last line as follows
>
>oDBStorage.InsertData(DBNull.Value, CType(oCouponGroup,

Object))
>
>
>Thanks
>-Vinod
>
>This posting is provided "AS IS" with no warranties, and

confers no rights.
>
>EBusiness Server Team
>--------------------
>Content-Class: urn:content-classes:message
>From: "Ravi Shankar" <shankar.nospam@hp.com>
>Sender: "Ravi Shankar" <shankar.nospam@hp.com>
>Subject: HELP: What is wrong with this CODE !!!
>Date: Sat, 4 Sep 2004 01:16:47 -0700
>Lines: 44
>Message-ID: <5e2a01c49257$85cb9be0$a501280a@phx.gbl>
>MIME-Version: 1.0
>Content-Type: text/plain;
> charset="iso-8859-1"
>Content-Transfer-Encoding: 7bit
>X-Newsreader: Microsoft CDO for Windows 2000
>X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
>thread-index: AcSSV4XLaQ9sO2mcSl+kV0U6t7caSA==
>Newsgroups: microsoft.public.commerceserver.general
>Path: cpmsftngxa10.phx.gbl
>Xref: cpmsftngxa10.phx.gbl

microsoft.public.commerceserver.general:14705
>NNTP-Posting-Host: tk2msftngxa13.phx.gbl 10.40.1.165
>X-Tomcat-NG: microsoft.public.commerceserver.general
>
>bit of a bind over this.
>
>(i've included the mscscorelib.dll and Commerce 1.0
>object) as com references into the project
>
>Imports Microsoft.CommerceServer.Interop
>Imports Microsoft.CommerceServer.RunTime
>Imports Microsoft.CommerceServer.RunTime.Configuration
>
>Dim oCouponGroup As New Dictionary
>Dim oCouponCollection As New
>System.Collections.Specialized.HybridDictionary
>Dim gOrderGroupID As Guid
>Dim sOrderGroupID As String
>Dim sUserID As String = "{0D93ED9A-1837-4FD6-8966-
>D635FB011DC6}"
>
>oDBStorage = New
>Microsoft.CommerceServer.Interop.Orders.DBStorage
>oDBStorage.InitStorage(oTransactionResource.Item
>

("connstr_db_transactions"), "CouponGroup", "coupongroup_i
>d
>user_id", "Commerce.Dictionary", "marshaled_data", "d_Dat

e
>LastChanged")
>
>gOrderGroupID = System.Guid.NewGuid()
>oCouponGroup.Value("coupongroup_id") =
>gOrderGroupID.ToString()
>
>oCouponGroup.Value("user_id") = sUserID
>oCouponGroup.Value("coupon_collection") =
>oCouponCollection
>
>oCouponGroup.Value("total_coupons") =
>oCouponCollection.Count
>
>oDBStorage.InsertData(vbNull, CType(oCouponGroup,

Object))
>
>But it fails at this call with an error of
>type 'System.Runtime.InteropServices.COMException' that
>says "Type Mismatch"
>
>What am I missing in this ?
>Regards.
>

Ravi Shankar

2004-09-24, 2:48 am

Some progress based on Nihit's response to a similar
previous post I'd made (attached here for both your
reference)..

In the table structure I'd defined the fields as
UniqueIdentifier but I was assigning strings so the
error. I changed that so in the code I'm assigning
System.GUID type.

But now a new Error (in either case HybridDictionary or
Dictionary) which is...


An unhandled exception of type 'System.ArgumentException'
occurred in CS2K2NET.exe

Additional information: XML variant datatype not supported

----
Any ideas ?
---------------------------------------------
. Reply (E-mail) Forward (E-mail)

Subject: RE: accessing marshaled_data using
DBStorage !!
From: "Nihit Kaul [MSFT]" <nihitk@online.microsoft.com>
Sent: 9/23/2004 6:16:53 PM




Hi Ravi,

Have you tried using some other class instead of
HybridDictionary for the
oCouponCollection? Say for e.g. Dictionary object itself
or a HashTable
etc.?

Also - which is the exact field that causes the DBStorage
InsertData call
to fail?

Thanks,

Nihit Kaul[MSFT]
Commerce Server
http://blogs.msdn.com/nihitk

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
--------------------
Content-Class: urn:content-classes:message
From: "Ravi Shankar" <shankar.nospam@hp.com>
Sender: "Ravi Shankar" <shankar.nospam@hp.com>
References: <34cc01c48f3c$b9d99270$a301280a@phx.gbl>
Subject: accessing marshaled_data using DBStorage !!
Date: Tue, 31 Aug 2004 05:13:25 -0700
Lines: 59
Message-ID: <35a601c48f53$ea5b3540$a601280a@phx.gbl>
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
thread-index: AcSPU+pYrnYexHEJRs6YXlWMlp98cA==
Newsgroups: microsoft.public.commerceserver.general
Path: cpmsftngxa10.phx.gbl
Xref: cpmsftngxa10.phx.gbl
microsoft.public.commerceserver.general:14679
NNTP-Posting-Host: tk2msftngxa14.phx.gbl 10.40.1.166
X-Tomcat-NG: microsoft.public.commerceserver.general

Ok. I located that and trying to do something using
VB.Net as so..

(i've included the mscscorelib.dll and Commerce 1.0
object) as com references into the project

Imports Microsoft.CommerceServer.Interop
Imports Microsoft.CommerceServer.RunTime
Imports Microsoft.CommerceServer.RunTime.Configuration

Dim oCouponGroup As New Dictionary
Dim oCouponCollection As New
System.Collections.Specialized.HybridDictionary
Dim gOrderGroupID As Guid
Dim sOrderGroupID As String
Dim sUserID As String = "{0D93ED9A-1837-4FD6-8966-
D635FB011DC6}"

oDBStorage = New
Microsoft.CommerceServer.Interop.Orders.DBStorage
oDBStorage.InitStorage(oTransactionResource.Item
("connstr_db_transactions"), "CouponGroup", "coupongroup_i
d
user_id", "Commerce.Dictionary", "marshaled_data", "d_Date
LastChanged")

gOrderGroupID = System.Guid.NewGuid()
oCouponGroup.Value("coupongroup_id") =
gOrderGroupID.ToString()

oCouponGroup.Value("user_id") = sUserID
oCouponGroup.Value("coupon_collection") =
oCouponCollection

oCouponGroup.Value("total_coupons") =
oCouponCollection.Count

oDBStorage.InsertData(vbNull, CType(oCouponGroup, Object))

But it fails at this call with an error of
type 'System.Runtime.InteropServices.COMException' thats
says "Type Mismatch"

I have a feeling its to do with which Dictionary
Defintion is getting picked up but if I get the same
error if I use the IDictionary.. (and instantiate it as
Dictionary)

Can someone help !
>-----Original Message-----
>Sometime back there was a discussion on
>accessing/processing marshaled_data !!!
>
>I can't seem to locate those threads.. Could someone
>throw fresh light on the topic please.
>
>Regards.
>.
>



>-----Original Message-----
>Nope ! Still the same error
>
>The table structure is as follows
>
>'CREATE TABLE [CouponGroup] (
>' [coupongroup_id] [uniqueidentifier] NOT NULL ,
>' [user_id] [uniqueidentifier] NOT NULL ,
>' [total_coupons] [int] NOT NULL CONSTRAINT
>[DF_CouponGroup_total_coupons] DEFAULT (0),
>' [marshaled_data] [image] NULL ,
>' [g_UserIdChangedBy] [uniqueidentifier] NULL ,
>' [d_DateLastChanged] [datetime] NULL ,
>' [d_DateCreated] [datetime] NULL
>') ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
>' GO()
>
>
>Object))
and[vbcol=seagreen]
>confers no rights.
>microsoft.public.commerceserver.general:14705
>

("connstr_db_transactions"), "CouponGroup", "coupongroup_i
t[vbcol=seagreen]
>e
>Object))
>.
>

Vinod Kumar[MSFT]

2004-10-03, 5:50 pm

You cannot add Guid type in the Commerce Dictionary. There is no equivalent
of Guid type in the COM world. You've to pass the string instead.

This posting is provided "AS IS" with no warranties, and confers no rights.

EBusiness Server Team
--------------------
Content-Class: urn:content-classes:message
From: "Ravi Shankar" <shankar.nospam@hp.com>
Sender: "Ravi Shankar" <shankar.nospam@hp.com>
References: <5e2a01c49257$85cb9be0$a501280a@phx.gbl>
<6NpcuJcoEHA.1520@cpmsftngxa06.phx.gbl>
<2c6e01c4a1fa$132dc880$a601280a@phx.gbl>
Subject: RE: HELP: What is wrong with this CODE !!!
Date: Thu, 23 Sep 2004 23:10:31 -0700
Lines: 245
Message-ID: <2c9f01c4a1fd$32472e20$a601280a@phx.gbl>
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
thread-index: AcSh/TJCgW+qY77vTliTsg1AfuJuNA==
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
Newsgroups: microsoft.public.commerceserver.general
Path: cpmsftngxa06.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.commerceserver.general:14836
NNTP-Posting-Host: tk2msftngxa14.phx.gbl 10.40.1.166
X-Tomcat-NG: microsoft.public.commerceserver.general

Some progress based on Nihit's response to a similar
previous post I'd made (attached here for both your
reference)..

In the table structure I'd defined the fields as
UniqueIdentifier but I was assigning strings so the
error. I changed that so in the code I'm assigning
System.GUID type.

But now a new Error (in either case HybridDictionary or
Dictionary) which is...


An unhandled exception of type 'System.ArgumentException'
occurred in CS2K2NET.exe

Additional information: XML variant datatype not supported

----
Any ideas ?
---------------------------------------------
. Reply (E-mail) Forward (E-mail)

Subject: RE: accessing marshaled_data using
DBStorage !!
From: "Nihit Kaul [MSFT]" <nihitk@online.microsoft.com>
Sent: 9/23/2004 6:16:53 PM




Hi Ravi,

Have you tried using some other class instead of
HybridDictionary for the
oCouponCollection? Say for e.g. Dictionary object itself
or a HashTable
etc.?

Also - which is the exact field that causes the DBStorage
InsertData call
to fail?

Thanks,

Nihit Kaul[MSFT]
Commerce Server
http://blogs.msdn.com/nihitk

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
--------------------
Content-Class: urn:content-classes:message
From: "Ravi Shankar" <shankar.nospam@hp.com>
Sender: "Ravi Shankar" <shankar.nospam@hp.com>
References: <34cc01c48f3c$b9d99270$a301280a@phx.gbl>
Subject: accessing marshaled_data using DBStorage !!
Date: Tue, 31 Aug 2004 05:13:25 -0700
Lines: 59
Message-ID: <35a601c48f53$ea5b3540$a601280a@phx.gbl>
MIME-Version: 1.0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
thread-index: AcSPU+pYrnYexHEJRs6YXlWMlp98cA==
Newsgroups: microsoft.public.commerceserver.general
Path: cpmsftngxa10.phx.gbl
Xref: cpmsftngxa10.phx.gbl
microsoft.public.commerceserver.general:14679
NNTP-Posting-Host: tk2msftngxa14.phx.gbl 10.40.1.166
X-Tomcat-NG: microsoft.public.commerceserver.general

Ok. I located that and trying to do something using
VB.Net as so..

(i've included the mscscorelib.dll and Commerce 1.0
object) as com references into the project

Imports Microsoft.CommerceServer.Interop
Imports Microsoft.CommerceServer.RunTime
Imports Microsoft.CommerceServer.RunTime.Configuration

Dim oCouponGroup As New Dictionary
Dim oCouponCollection As New
System.Collections.Specialized.HybridDictionary
Dim gOrderGroupID As Guid
Dim sOrderGroupID As String
Dim sUserID As String = "{0D93ED9A-1837-4FD6-8966-
D635FB011DC6}"

oDBStorage = New
Microsoft.CommerceServer.Interop.Orders.DBStorage
oDBStorage.InitStorage(oTransactionResource.Item
("connstr_db_transactions"), "CouponGroup", "coupongroup_i
d
user_id", "Commerce.Dictionary", "marshaled_data", "d_Date
LastChanged")

gOrderGroupID = System.Guid.NewGuid()
oCouponGroup.Value("coupongroup_id") =
gOrderGroupID.ToString()

oCouponGroup.Value("user_id") = sUserID
oCouponGroup.Value("coupon_collection") =
oCouponCollection

oCouponGroup.Value("total_coupons") =
oCouponCollection.Count

oDBStorage.InsertData(vbNull, CType(oCouponGroup, Object))

But it fails at this call with an error of
type 'System.Runtime.InteropServices.COMException' thats
says "Type Mismatch"

I have a feeling its to do with which Dictionary
Defintion is getting picked up but if I get the same
error if I use the IDictionary.. (and instantiate it as
Dictionary)

Can someone help !
>-----Original Message-----
>Sometime back there was a discussion on
>accessing/processing marshaled_data !!!
>
>I can't seem to locate those threads.. Could someone
>throw fresh light on the topic please.
>
>Regards.
>.
>



>-----Original Message-----
>Nope ! Still the same error
>
>The table structure is as follows
>
>'CREATE TABLE [CouponGroup] (
>' [coupongroup_id] [uniqueidentifier] NOT NULL ,
>' [user_id] [uniqueidentifier] NOT NULL ,
>' [total_coupons] [int] NOT NULL CONSTRAINT
>[DF_CouponGroup_total_coupons] DEFAULT (0),
>' [marshaled_data] [image] NULL ,
>' [g_UserIdChangedBy] [uniqueidentifier] NULL ,
>' [d_DateLastChanged] [datetime] NULL ,
>' [d_DateCreated] [datetime] NULL
>') ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
>' GO()
>
>
>Object))
and[vbcol=seagreen]
>confers no rights.
>microsoft.public.commerceserver.general:14705
>

("connstr_db_transactions"), "CouponGroup", "coupongroup_i
t[vbcol=seagreen]
>e
>Object))
>.
>


Ravi Shankar

2004-10-07, 2:55 am

Hi Vinod,

The minute I switch back to "string" after having changed
the database type in the table to nvarchar (from
uniqueidentifier) and pass strings, I start getting
the "Type Mismatch" error.

Regards.
>-----Original Message-----
>You cannot add Guid type in the Commerce Dictionary.

There is no equivalent
>of Guid type in the COM world. You've to pass the string

instead.
>
>This posting is provided "AS IS" with no warranties, and

confers no rights.
>
>EBusiness Server Team
>--------------------
>Content-Class: urn:content-classes:message
>From: "Ravi Shankar" <shankar.nospam@hp.com>
>Sender: "Ravi Shankar" <shankar.nospam@hp.com>
>References: <5e2a01c49257$85cb9be0$a501280a@phx.gbl>
><6NpcuJcoEHA.1520@cpmsftngxa06.phx.gbl>
><2c6e01c4a1fa$132dc880$a601280a@phx.gbl>
>Subject: RE: HELP: What is wrong with this CODE !!!
>Date: Thu, 23 Sep 2004 23:10:31 -0700
>Lines: 245
>Message-ID: <2c9f01c4a1fd$32472e20$a601280a@phx.gbl>
>MIME-Version: 1.0
>Content-Type: text/plain;
> charset="iso-8859-1"
>Content-Transfer-Encoding: 7bit
>X-Newsreader: Microsoft CDO for Windows 2000
>thread-index: AcSh/TJCgW+qY77vTliTsg1AfuJuNA==
>X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
>Newsgroups: microsoft.public.commerceserver.general
>Path: cpmsftngxa06.phx.gbl
>Xref: cpmsftngxa06.phx.gbl

microsoft.public.commerceserver.general:14836
>NNTP-Posting-Host: tk2msftngxa14.phx.gbl 10.40.1.166
>X-Tomcat-NG: microsoft.public.commerceserver.general
>
>Some progress based on Nihit's response to a similar
>previous post I'd made (attached here for both your
>reference)..
>
>In the table structure I'd defined the fields as
>UniqueIdentifier but I was assigning strings so the
>error. I changed that so in the code I'm assigning
>System.GUID type.
>
>But now a new Error (in either case HybridDictionary or
>Dictionary) which is...
>
>
>An unhandled exception of

type 'System.ArgumentException'
>occurred in CS2K2NET.exe
>
>Additional information: XML variant datatype not

supported
>
> ----
>Any ideas ?
>---------------------------------------------
> . Reply (E-mail) Forward (E-mail)
>
> Subject: RE: accessing marshaled_data using
>DBStorage !!
> From: "Nihit Kaul [MSFT]"

<nihitk@online.microsoft.com>
>Sent: 9/23/2004 6:16:53 PM
>
>
>
>
>Hi Ravi,
>
>Have you tried using some other class instead of
>HybridDictionary for the
>oCouponCollection? Say for e.g. Dictionary object itself
>or a HashTable
>etc.?
>
>Also - which is the exact field that causes the

DBStorage
>InsertData call
>to fail?
>
>Thanks,
>
>Nihit Kaul[MSFT]
>Commerce Server
>http://blogs.msdn.com/nihitk
>
>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
>--------------------
>Content-Class: urn:content-classes:message
>From: "Ravi Shankar" <shankar.nospam@hp.com>
>Sender: "Ravi Shankar" <shankar.nospam@hp.com>
>References: <34cc01c48f3c$b9d99270$a301280a@phx.gbl>
>Subject: accessing marshaled_data using DBStorage !!
>Date: Tue, 31 Aug 2004 05:13:25 -0700
>Lines: 59
>Message-ID: <35a601c48f53$ea5b3540$a601280a@phx.gbl>
>MIME-Version: 1.0
>Content-Type: text/plain;
> charset="iso-8859-1"
>Content-Transfer-Encoding: 7bit
>X-Newsreader: Microsoft CDO for Windows 2000
>X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
>thread-index: AcSPU+pYrnYexHEJRs6YXlWMlp98cA==
>Newsgroups: microsoft.public.commerceserver.general
>Path: cpmsftngxa10.phx.gbl
>Xref: cpmsftngxa10.phx.gbl
>microsoft.public.commerceserver.general:14679
>NNTP-Posting-Host: tk2msftngxa14.phx.gbl 10.40.1.166
>X-Tomcat-NG: microsoft.public.commerceserver.general
>
>Ok. I located that and trying to do something using
>VB.Net as so..
>
>(i've included the mscscorelib.dll and Commerce 1.0
>object) as com references into the project
>
>Imports Microsoft.CommerceServer.Interop
>Imports Microsoft.CommerceServer.RunTime
>Imports Microsoft.CommerceServer.RunTime.Configuration
>
>Dim oCouponGroup As New Dictionary
>Dim oCouponCollection As New
>System.Collections.Specialized.HybridDictionary
>Dim gOrderGroupID As Guid
>Dim sOrderGroupID As String
>Dim sUserID As String = "{0D93ED9A-1837-4FD6-8966-
>D635FB011DC6}"
>
>oDBStorage = New
>Microsoft.CommerceServer.Interop.Orders.DBStorage
>oDBStorage.InitStorage(oTransactionResource.Item
>

("connstr_db_transactions"), "CouponGroup", "coupongroup_i
>d
>user_id", "Commerce.Dictionary", "marshaled_data", "d_Dat

e
>LastChanged")
>
>gOrderGroupID = System.Guid.NewGuid()
>oCouponGroup.Value("coupongroup_id") =
>gOrderGroupID.ToString()
>
>oCouponGroup.Value("user_id") = sUserID
>oCouponGroup.Value("coupon_collection") =
>oCouponCollection
>
>oCouponGroup.Value("total_coupons") =
>oCouponCollection.Count
>
>oDBStorage.InsertData(vbNull, CType(oCouponGroup,

Object))
>
>But it fails at this call with an error of
>type 'System.Runtime.InteropServices.COMException' thats
>says "Type Mismatch"
>
>I have a feeling its to do with which Dictionary
>Defintion is getting picked up but if I get the same
>error if I use the IDictionary.. (and instantiate it as
>Dictionary)
>
>Can someone help !
>
>
(oCouponGroup,[vbcol=seagreen]
>and
V5.50.4910.0300[vbcol=seagreen]
>

("connstr_db_transactions"), "CouponGroup", "coupongroup_i
a[vbcol=seagreen]
>t
that[vbcol=seagreen]
>

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com