473,503 Members | 2,238 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Web Service Returns DataTable or DataReader

Dear all,

How to code a Web Service function that returns either a DataTable or
DataReader to the clients? Or I should use other alternative?

Thanks for any help!

Tedmond
Mar 2 '06 #1
4 2549
Tedmond,

A pity is that the 2.0 sample seems never to be completed, it has some
problem especially about the Datatable.haschanges in it, a method that seems
for me to be forgotten to make in Net 2.0.

http://msdn2.microsoft.com/en-us/library/1as0t7ff.aspx

You can instead of that haschanges use
If datatable.Getchanges NotIs Nothing then (or the equivalent for C#)

I hope this helps,

Cor
"Tedmond" <Te*****@discussions.microsoft.com> schreef in bericht
news:39**********************************@microsof t.com...
Dear all,

How to code a Web Service function that returns either a DataTable or
DataReader to the clients? Or I should use other alternative?

Thanks for any help!

Tedmond

Mar 2 '06 #2

A web method can return any datatype which is serializable in the SOAP XML
format.

Tedmond wrote:
Dear all,

How to code a Web Service function that returns either a DataTable or
DataReader to the clients? Or I should use other alternative?

Thanks for any help!

Tedmond


--
Mar 2 '06 #3
Hi John,

I have a testing web method that returns a DataView. It compiled ok but
when I update the web reference from client application project, I got the
following error,

<html>
.......
<title>You must implement the Add(System.Data.DataRowView) method on
System.Data.Datavidw because it inherits from ICollection.</title>
.....

Why? How can I solve it?

My web method is something like

[WebMethod(Description="Method returns DataView")]
[SoapInclude(typeof(DataView))]
public DataView getConfirmListDV(string returnNo)
{
DataView dv = new DataView();
...

return dv;
}

Thanks for your help!

Tedmond
"John Bailo" wrote:

A web method can return any datatype which is serializable in the SOAP XML
format.

Tedmond wrote:
Dear all,

How to code a Web Service function that returns either a DataTable or
DataReader to the clients? Or I should use other alternative?

Thanks for any help!

Tedmond


--

Mar 3 '06 #4
Tedmond,

You never can pass a dataview outside your current application. The dataview
is an object that only holds references to other objects (DataTables) inside
your application. Those tables (only one at a time) are referenced by the
property. DataView.Table.

I hope this helps,

Cor
Mar 3 '06 #5

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

Similar topics

8
1587
by: Stephen | last post by:
I am trying to add some code to below to include a datatable and fill the datatable. The reason for doing this is so as I can check to see whether there are any rows returned by the stored...
6
1742
by: Mountain Bikn' Guy | last post by:
When one gets a row from a database (ie, a DataTable), the row contains a typed value in each column. How is this typically implemented behind scenes. I want to build this functionality myself. The...
1
1223
by: Janaka | last post by:
I've got a DataSet which I'd like to be able to get all the values out of one of the DataTable columns. These may be either string or integer values. What I'd like ideally is to be able to get...
3
1946
by: Tim::.. | last post by:
Can anyone tell me how to achieve the following... I want to convert data from a DataReader into a DataTable... I was told this should do it but it doesn't seem to work! Dim Myconn As New...
2
4271
by: neilr | last post by:
Can anyone help with some problkems that have wasted 2 days of my (inexperienced) time already? We have a website which allows people to register for events like conferences We are importing...
7
3376
by: Varangian | last post by:
Hi all, the question I want to ask if the conversion of a DataReader to a Table looping through the DataReader is better than using the Fill Method of the DataAdapter... I'm asking because...
9
12000
by: jsoques | last post by:
Hello, I created a Web Service using .Net 2.0 that has a function that returns a DataTable. I can test the function from the web page when I access the .asmx from a browser on localhost and it...
15
13480
by: Joseph Geretz | last post by:
I'm a bit puzzled by the current recommendation not to send Datasets or Datatables between application tiers. http://support.microsoft.com/kb/306134 ...
5
5878
by: jehugaleahsa | last post by:
Hello: What is the point of using a DataTable in ASP .NET? We are unsure how you can use them without 1) rebuilding them every postback, or 2) taking up precious memory. We are not sure how to...
0
7205
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7093
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
7287
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
7468
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5596
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5023
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
4689
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
3170
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
747
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.