SQLDataTypes and Serialization

  • Thread starter Thread starter David
  • Start date Start date
D

David

I am trying to use the SQlDataTypes, instead of the
standard Dot NET datatypes, because I want to be able to
set variables to null if the user chooses to not to input
any data.

This all seemed to work fine until I tried to pass a
variable declared as a sqldatatype into my Data Access
Layer, which is in COM+. This caused the exception...

"The type System.Data.SqlTypes.SqlInt16 in Assembly
System.Data, Version=1.0.3300.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089 is not marked as
serializable."

So from this exception I would assume that the
SQLDataTypes are not Serilizable, however what seems to
fog the issue some what is that we have another project
which makes use of SQLDataTypes, which failed when trying
to pass the SQLDataType to a compiled com+ project, but if
both the project are in com + succesfully passes the
SQLDataType.

So what I really want to know is are the SQLDataTYpes
serializable or not, if they are not how can I make them
work with COM +?

Thanks In Advance

david
 
I suppose the problem in your case is that you have deployed the component
in a COM+ server application and when you call upon methods on that
component, the method arguments would need to be serialized (remember, it is
running out of process in an other app domain). You would not get this
problem when calls are made in - process (in same appdomain as you saw in
the second case) or the component is in a COM+ library application.
I would say use normal data types as arguments to the method and then
synthesize corresponding SQLDataTypes there. Or run your COM+ app as a
library app.
 
Hi

Thanks for that, yes the call with the sql data type is
calling a procedure within a com + library app, suddenly
it all makes sense. The simplest way round this is for me
to go back to using the Dot Net data types.

Thanks

David

-----Original Message-----
I suppose the problem in your case is that you have deployed the component
in a COM+ server application and when you call upon methods on that
component, the method arguments would need to be serialized (remember, it is
running out of process in an other app domain). You would not get this
problem when calls are made in - process (in same appdomain as you saw in
the second case) or the component is in a COM+ library application.
I would say use normal data types as arguments to the method and then
synthesize corresponding SQLDataTypes there. Or run your COM+ app as a
library app.

--
HTH,
Manoj G [.NET MVP]
Site: http://www15.brinkster.com/manoj4dotnet
Blog: http://msmvps.com/manoj/

David said:
I am trying to use the SQlDataTypes, instead of the
standard Dot NET datatypes, because I want to be able to
set variables to null if the user chooses to not to input
any data.

This all seemed to work fine until I tried to pass a
variable declared as a sqldatatype into my Data Access
Layer, which is in COM+. This caused the exception...

"The type System.Data.SqlTypes.SqlInt16 in Assembly
System.Data, Version=1.0.3300.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089 is not marked as
serializable."

So from this exception I would assume that the
SQLDataTypes are not Serilizable, however what seems to
fog the issue some what is that we have another project
which makes use of SQLDataTypes, which failed when trying
to pass the SQLDataType to a compiled com+ project, but if
both the project are in com + succesfully passes the
SQLDataType.

So what I really want to know is are the SQLDataTYpes
serializable or not, if they are not how can I make them
work with COM +?

Thanks In Advance

david


.
 
Back
Top