Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 1.0 and 1.1 > ASP.NET 1.0 and 1.1 Basics
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 10th, 2004, 12:14 PM
Authorized User
 
Join Date: Jun 2003
Posts: 33
Thanks: 0
Thanked 0 Times in 0 Posts
Default Return DataTable from Web Method Function

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

 
Old February 10th, 2004, 12:40 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

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.
 
Old February 11th, 2004, 06:23 AM
Authorized User
 
Join Date: Jun 2003
Posts: 33
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks Planoie,
It works, wonder why I did not try the whole DataSet in the 1st place.

Cheers
Kasie :)







Similar Threads
Thread Thread Starter Forum Replies Last Post
Return datatable from a webmethod josemanjusha ASP.NET 2.0 Basics 0 September 21st, 2006 07:52 AM
Return Collection object from a Web Method raybo .NET Web Services 2 June 17th, 2006 07:42 AM
COM .NET Interop - How to return a DataTable from jhpe VS.NET 2002/2003 1 July 19th, 2005 01:29 PM
Return DataSet / DataTable from Stored Procedure ashu_from_india ADO.NET 3 March 20th, 2005 05:39 AM
Return OleDb.OleDbConnection from the WEB method? Dmitriy Pro VB 6 2 May 4th, 2004 07:10 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.