Ask a Question related to ASP.NET Web Services, Design and Development.
-
Aleksey Nudelman #1
DataTable as parm to a WebMethod function?
According to MS, DataTable cannot be passed or returned by
a Web Service.
Try using DataSet instead.
Aleksey>-----Original Message-----
>
>I've stumbled across a problem while developing an
>ASP.NET Web Service that I hope someone can shed some
>light on. The problem occurs any time I include a
>System.Data.DataTable object in the parameter list of a
>WebMethod call. The Web Service project builds fine, but
>when you navigate in your browser to the .asmx file then
>you get an error message that basically says: "Cannot
>serialize member
>System.ComponentModel.MarshalByValueComponent.Sit e of
>type System.ComponentModel.ISite because it is an
>interface."
>
>The docs state that the only 2 data objects that are
>serializable are the DataSet and the DataTable, so I
>would assume that this means I can pass either object
>into and out of a web service. Furthermore, a DataSet can
>be serialized without a problem....even though a DataSet
>contains a collection of DataTables.
>
>It's very easy to duplicate this problem. Just include
>the following WebMethod call in an ASP.NET Web Service
>project and then pull up the associated .asmx file. IE
>will display a page long error description that basically
>shows that a DataTable cannot be serialized (reflected)
>to XML. Here's a sample WebMethod call in VB.NET:
>
><WebMethod()> Public Sub TestTable(ByVal dataTbl As
>System.Data.DataTable)
> ' Do Nothing
>End Sub
>
>
>I've tried this example running versions 1.0.3705 and
>1.1.4322 of the frameworks, if that helps any. I've
>searched the KB and google's archived newsgroups but I
>can't seem to find any info relating to this issue. I've
>also tried running this sample on 2 separate boxes and I
>always end up with the same results.
>
>Any clues?
>
>Thanks much.
>Keith Primeaux, MCSD
>Automated Filing Systems, Inc.
>.
>Aleksey Nudelman Guest
-
ADODB.Recordset as parm to Web Service
How can I go about transforming an ADODB.Recordset in such a way that it's XML representation can be passed as a parameter to a Web Service? I... -
Is it possible to return just a DataTable from a WebMethod, instead of DataSet?
Hi all, I just want to make sure i'm not doing anything stupid, but it seems to me that its not possible to return a simple datatable from a... -
VBScript: What is default function parm type - ByVal or ByRef?
I know this should be a no-brainer, but I am seeing odd results in my ASP VBScript function calls with the passed parameters. In VBScript, is the... -
how to get row if in datatable?
I need to modify a datatable. I am wondering how to get the datatable row index number? assuming I have a column 0 whose entry is unique. Thanks. -
DataTable parameter of a WebMethod?
DataTable is not serializable, you have to put them in a dataset. DataTable object to it. I visit the .asmx can't pass in a...



Reply With Quote

