Is it possible to return just a DataTable from a WebMethod, instead of DataSet?

T

Tim Medcalf

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 WebMethod - it has
to be a full dataset.

The online help seems to state that it is possible with either dataset or
datatable (both remotable, both serializable), but only dataset works for
me.

If i try it with a datatable, when querying the asmx file, i get a message
saying the object cannot be serialized becuase it is an interface. It works
fine when the same datatable is added to a dataset.

Is this correct or am i doing something silly?

Additionally, if this is correct behaviour, could anyone tell my why it is?
Both objects descend from MarshalByValue, and both have the same Interfaces
according to the docs. Any ideas?

Thanks in advance

Tim
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top