473,569 Members | 2,765 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 2561
Tedmond,

A pity is that the 2.0 sample seems never to be completed, it has some
problem especially about the Datatable.hasch anges 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.Getch anges NotIs Nothing then (or the equivalent for C#)

I hope this helps,

Cor
"Tedmond" <Te*****@discus sions.microsoft .com> schreef in bericht
news:39******** *************** ***********@mic rosoft.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.Dat avidw because it inherits from ICollection.</title>
.....

Why? How can I solve it?

My web method is something like

[WebMethod(Descr iption="Method returns DataView")]
[SoapInclude(typ eof(DataView))]
public DataView getConfirmListD V(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
1595
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 procedure. If there are no records returned then this would give me an indicator and I can re-direct the page somewhere more appropriate. Well this is the...
6
1749
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 reason I want to do this is because I need an in-memory table without any of the overhead of a DataSet or DataTable. Thanks!
1
1230
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 each row in the column of the DataTable into a typed array. Is there something similar to Split() that I can use on one of these objects? Otherwise...
3
1951
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 SqlConnection(ConfigurationSettings.AppSettings("strConn")) Dim tbcontactsNonAD As DataTable = New DataTable("contactsNonAD") Dim cmd As New...
2
4277
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 a table of fees for the apporpriate event using an Sp: FeesDataSet = New System.Data.DataSet Dim MySPcommand As New System.Data.SqlClient.SqlCommand...
7
3388
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 internally the DataAdapter uses the DataReader... so whats the deal of writing a method that converts a DataReader into a DataTable ? Thanks!
9
12006
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 works. I can also test the function using VB6 and the xmlhttp activex object. The problem I have now is when using VS 2005 or VB.Net 2005 Express and...
15
13490
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 http://msdn2.microsoft.com/en-us/library/ms996381.aspx Formerly, with classic Microsoft DNA architecture, the ADO Recordset was a primary transport medium, recommended for transmitting data...
5
5887
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 store a DataTable in any other way outside of our servers. In doing so, we leave ourselves open to large memory requirements. Furthermore, most web...
0
7924
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8120
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7968
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6283
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5512
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3653
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3640
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2113
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1212
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.