Subject: Return DataTable from Web Method Function
Posted By: kasie Post Date: 2/10/2004 11:14:52 AM
Either VB.Net or C# language
Can any one tell me, can you return DataTable object from WebMethod function in ASP.Net WebService.
I tried create one, its complied ok, but when test run it causes exception error, something to do with Interface of DataTable class. I am new to ASP.Net so have not got a clue!!
Anything to do with Web protocol such as SOAP, as I do not know this area as well.. Please help.

Thanks in advance
Kasie

Reply By: planoie Reply Date: 2/10/2004 11:40:18 AM
I have had the same problem.  It's because you can't return just a DataTable. You must return the entire dataset.  This ensures that the table schema is carried with the table so the table can be correctly recreated on the other end of the SOAP request (i.e. the consuming end).

Peter
------------------------------------------------------
Work smarter, not harder.
Reply By: kasie Reply Date: 2/11/2004 5:23:04 AM
Thanks Planoie,
It works, wonder why I did not try the whole DataSet in the 1st place.

Cheers
Kasie



Go to topic 9660

Return to index page 951
Return to index page 950
Return to index page 949
Return to index page 948
Return to index page 947
Return to index page 946
Return to index page 945
Return to index page 944
Return to index page 943
Return to index page 942