Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > I thought I heard that v2 would allow a WebService to return a DataTable.

Reply
Thread Tools

I thought I heard that v2 would allow a WebService to return a DataTable.

 
 
Tony
Guest
Posts: n/a
 
      02-11-2006
I thought I heard that v2 would allow a WebService to return a DataTable.
I've tried this but it doesn't seem to work, the WebService compiles but I
can't hook a client up to the method, so I have resorted back to creating a
DataSet just to transport a stupid DataTable which seems like such a waste
of code, execution time, and network bandwidth.

Am I missing something???

Thanks,
Tony


 
Reply With Quote
 
 
 
 
Josh Twist
Guest
Posts: n/a
 
      02-11-2006
Hi Tony,

Sorry I'm not answering your question here but you may be interested in
this. I tend to point most people at thsi who ask about returning
DataSets and DataTables - it maybe worth a rethink

http://www.hanselman.com/blog/Return...nTheWorld.aspx

Josh
http://www.thejoyofcode.com/

 
Reply With Quote
 
 
 
 
Tony
Guest
Posts: n/a
 
      02-11-2006
Yes, but that is not of much help since it just states you shouldn't but
doesn't provide a better alternative.
I'm open to suggestions of a better workable solution.

Tony

"Josh Twist" <> wrote in message
news: oups.com...
> Hi Tony,
>
> Sorry I'm not answering your question here but you may be interested in
> this. I tend to point most people at thsi who ask about returning
> DataSets and DataTables - it maybe worth a rethink
>
> http://www.hanselman.com/blog/Return...nTheWorld.aspx
>
> Josh
> http://www.thejoyofcode.com/
>



 
Reply With Quote
 
Josh Twist
Guest
Posts: n/a
 
      02-12-2006
The better alternative is to return 'real' objects. For example, if
your WebMethod is called GetApple, then your web service should return
'Apples'. That is a class Apple with the appropriate properties rather
than returning a DataSet/Table that contains columns with properties of
Apples. It's what web services are all about.

public class Apples
{
public string Type;
public int Weight;
public string Color;
}

Anyway, good luck however you decide to proceed!

Josh
http://www.thejoyofcode.com/

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
problem in running a basic code in python 3.3.0 that includes HTML file Satabdi Mukherjee Python 1 04-04-2013 07:48 PM
Just curious - I thought dict keys would maintain sequence Frank Millman Python 0 03-18-2013 07:26 AM
Thought you would enjoy some funny math cartoons!!! craig.snodgrass@gmail.com Python 0 12-07-2007 02:49 AM
CSS Not What I Thought It Would Be Tim Milstead HTML 21 03-08-2006 12:53 AM
I just thought it would be cool... =Carnage= Computer Information 2 07-16-2004 03:36 AM



Advertisments