473,461 Members | 1,841 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Is it possible to return a DataTable from a Webservice method

Hi All,

I was just wondering whether is it possible to return a Data Table
from a WebService method. Since I need to send only one table at a
time, I dont want to return the entire Dataset.

Any help would be highly appreciated.

Cheers

Ganga.
Nov 21 '05 #1
2 18760
No, it is not possible to return a DataTable from a web service. You will
need to wrap it inside a DataSet.

See http://support.microsoft.com/default...b;en-us;306134

Regards,
Sami

"Ganga" <ga***@spectradata.co.nz> wrote in message
news:30**************************@posting.google.c om...
Hi All,

I was just wondering whether is it possible to return a Data Table
from a WebService method. Since I need to send only one table at a
time, I dont want to return the entire Dataset.

Any help would be highly appreciated.

Cheers

Ganga.

Nov 21 '05 #2
Sami wrote:
No, it is not possible to return a DataTable from a web service. You will
need to wrap it inside a DataSet.

See http://support.microsoft.com/default...b;en-us;306134


Yes, that Knowledge Base article advocates returning a DataSet from a Web
service. However that should be considered a poor practice from a
service-orientation perspective. One of the tenets of service-orientation is
that services share contract and schema ... and nothing else. Passing a
DataSet between Web services violates this tenet, and the result is that it
will only work so long as both endpoints are always .NET platforms.

A better solution would be to pass entity data that is domain- or
business-specific. Not a DataTable, but a set of data that has an actual XSD
schema generated in the WSDL for the Web services so that it can be used by
clients on any platform.

Cheers,
Stuart Celarier, Fern Creek
Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: R.A. | last post by:
Hi, I have an web service method that accept an xml document and returns a different xml document. Based on the input xml I fill a dataset with information from a database. If the dataset has...
12
by: Jose Fernandez | last post by:
Hello. I'm building a web service and I get this error. NEWS.News.CoverNews(string)': not all code paths return a value This is the WebMethod public SqlDataReader CoverNews(string Sport)...
0
by: Bob Davies | last post by:
Hi I have a webservice that retrieves data from a database, this is then returned to the calling client application built in windows forms within a dataset, however upon attempting to create...
3
by: Emmanuel Gehin | last post by:
When I use the following code in VB.NET : Public Function test() As String Try Dim da1 As OdbcDataAdapter Dim i As Int32 Dim tfem As DataTable For i = 0 To 1000 da1 = New...
2
by: Ajit | last post by:
Is it possible to have a web service name in localized string. Let's say, can I have a web service developed in C# having class name in Japanese? I am trying to build a web service as follows ...
9
by: MSDNAndi | last post by:
Hi, I have a set of simple webservices calls that worked fine using .NET Framework 1.0. I am calling a Java/Apache based webservices, the calling side is not able to supply a proper WSDL. ...
0
by: Tony | last post by:
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...
3
by: Peter Longstaff | last post by:
Hi All, I am having trouble with my first effort at developing a web service. I have a methods, outlined below which should return a DataTable. public DataTable...
4
by: Jonathan | last post by:
I have a SQL stored procedure for adding a new record in a transactions table. It also has two return values: CounterID and IDKey. I want to create a webservice that accepts the 10 input...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.