Help! Object must implment IConvertible during Update

  • Thread starter Thread starter sjoshi
  • Start date Start date
S

sjoshi

Hello All
I have schema as such:

<xs:element name="OFDateProxies">
<xs:complexType>
<xs:sequence>
<xs:element name="M_CRProxy_OID" msdata:DataType="System.Guid,
mscorlib, Version=1.0.5000.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089"
type="xs:string" />
<xs:element name="M_CRProxy_SourceTimeStamp" type="xs:base64Binary" />
<xs:element name="C_CRBaseClass_TimeStamp" type="xs:int" />
</xs:complexType>
</xs:element>

No during Update based on the OID, I change all the values of
M_CRProxy_SourceTimeStamp using this:

row.M_CRProxy_SourceTimeStamp =

BitConverter.GetBytes(row.C_CRBaseClass_TimeStamp);

The Update command is declared as
sql = "Update COREProxy Set sourceTimeStamp=@sTS
Where M_CRProxy_OID=cast(@OID as uniqueidentifier)";

prm=updateCmd.Parameters.Add("@sTS", SqlDbType.Binary, 8, M_TSCOL);
prm = updateCmd.Parameters.Add("@OID", SqlDbType.VarChar);

However during update I get the IConvertible message.
Any ideas what I might be doing wrong here ??

thanks
Sunit
 
Can you show how you set up the data adapter, and the parameters? I
think it has something to do with how you are setting those up.

Also, what is the structure of the table you are entering the data into?
 
Here's the table script

CREATE TABLE [dbo].[COREProxy] (
[oid] [uniqueidentifier] NOT NULL ,
[dwProperties] [int] NOT NULL ,
[sourceTimeStamp] [binary] (8) NOT NULL ,
[COREPersistentFlags] [int] NOT NULL ,
[ts] [int] NOT NULL ,
[tsRelations] [int] NOT NULL
)
 
Back
Top