HELP: What is wrong with this CODE !!!
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > Microsoft Commerce Server > Commerce Server General > HELP: What is wrong with this CODE !!!




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    HELP: What is wrong with this CODE !!!  
Ravi Shankar


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-04-04 07: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.





[ Post a follow-up to this message ]



    RE: HELP: What is wrong with this CODE !!!  
Vinod Kumar[MSFT]


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-23-04 10: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.






[ Post a follow-up to this message ]



    RE: HELP: What is wrong with this CODE !!!  
Ravi Shankar


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-24-04 07: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.
>





[ Post a follow-up to this message ]



    RE: HELP: What is wrong with this CODE !!!  
Ravi Shankar


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-24-04 07: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)) 
>.
>





[ Post a follow-up to this message ]



    RE: HELP: What is wrong with this CODE !!!  
Vinod Kumar[MSFT]


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
10-03-04 10: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)) 
>.
>






[ Post a follow-up to this message ]



    RE: HELP: What is wrong with this CODE !!!  
Ravi Shankar


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
10-07-04 07: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] 
>





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 10:02 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register