473,508 Members | 2,363 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DataReader in a web service

Is it possible to return a SQLdatareader from a web
service?
Jul 19 '05 #1
2 8636
You cannot return a SqlDataReader from a Web Service. This
is a stream based object which cannot be serialized to
cross machines boundaries over SOAP. You can use the
DataSet instead.
-----Original Message-----
Is it possible to return a SQLdatareader from a web
service?
.

Jul 19 '05 #2
Hello and Greetings,

Dear David:
Well what you can do instead of using dataset (as it is heavy) just have the
datareader stream packed in some object that could be crossed over using web
services. I usually convert all my complex types into a string
implementation and at the other end (Webservice client) I convert it back.
It works for most of my implementations, though I have never tried to do
this with a datareader but I guess you can do it. Give it a try and reply
back with the results.

Remember there is a slight disadvantage attached to this practice. As such
implantations can only work with custom clients. It sort of beats the
underlying principle of universal interpretably of the web services.

Another option could be using Remoting if the scenario allows it.

By the datasets are heavy but you would have to agree that they are best way
to send large amounts of data (specifically relational data), as it is has
many options built into it and is natively supported by the Webservices.

Also don't forget to read the doc mentioned below on MSDN:

- Consuming a DataSet from an XML Web Service

J, Happy Coding
Take Care,

Rai Umair - .NET Question? .NET Answer! http://www.raiumair.com
"Dave O" <da***********@btinternet.com> wrote in message
news:67****************************@phx.gbl...
Is it possible to return a SQLdatareader from a web
service?

Jul 19 '05 #3

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

Similar topics

6
363
by: Yasutaka Ito | last post by:
Hi, My friend had a little confusion about the working of DataReader after reading an article from MSDN. Following is a message from him... <!-- Message starts --> I was going thru DataReader...
2
369
by: Dave O | last post by:
Is it possible to return a SQLdatareader from a web service?
20
5509
by: Mark | last post by:
Hi all, quick question , a DataView is memory resident "view" of data in a data table therefore once populated you can close the connection to the database. Garbage collection can then be used to...
2
2850
by: Grant | last post by:
Hi, I keep getting the following error message: InvalidOperationException: There is already an open DataReader associated with this Connection which must be closed first. I have read up...
1
3084
by: Brent | last post by:
I'm having a hard time wrapping my head around how to build a multi-dimensional array of n length out of a DataReader loop. Take this pseudo-code: ======================================= public...
8
10648
by: David Perona | last post by:
Hi all, I have a web service that connects to a SQL Server database and return an sqlDataReader Object. When launch the web service in the web browser, this exception is thrown: "Object...
4
2550
by: Tedmond | last post by:
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
7
2894
by: Diffident | last post by:
Hello All, I would like to use DataReader based accessing in my Data Access Layer (DAL). What is considered to be a best practice while returning from a DAL method that executes a query and...
4
1774
by: rikleo2001 | last post by:
Hello Experts. I need your help, I am new to XML web service, and I have to complete one task. Here is current situation. 1. I have web service running to recieve SOAP message from an...
0
7223
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
7321
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
7377
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...
1
7036
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
4705
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
3191
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
3179
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1547
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 ...
1
762
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.