473,385 Members | 1,642 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Please Help me- Returning DataSet from a Web Service

Hi All

My Web Service is returning a DataSet. I realized that we cannot
return a DataReader.. Normally we can use a DataReader( when not
using Web services) and access it as below to assign values of columns
of returned rows to Labels in the client aplication such as:

while (dtrJobDetails.Read())
{
l_shortjobdesc.Text = dtrJobDetails["shortjobdesc"].ToString();
}
where dtrJobDetails is a DataReader.

But now I am forced to return back a DataSet.. Is there anyway of
showing the individual column values returned from a DataSet in
individual labels like we do in a DataReader as above... I dont want
to show it in a DataGrid or a DataList...

Please help me.. I have been trying to figure this out since two
days..

Any help will be highly appreciated...
Thanks,
Sumaira
Nov 18 '05 #1
2 1232
Hi, you could try something like

DataSet oDS = ' Retrieved from your webservice'
Response.Write(oDS.Tables[0].DefaultView[0].Row["Blah"].ToString());

hth
Mark
"Sumaira Ahmad" <su***********@gmail.com> wrote in message
news:16**************************@posting.google.c om...
Hi All

My Web Service is returning a DataSet. I realized that we cannot
return a DataReader.. Normally we can use a DataReader( when not
using Web services) and access it as below to assign values of columns
of returned rows to Labels in the client aplication such as:

while (dtrJobDetails.Read())
{
l_shortjobdesc.Text = dtrJobDetails["shortjobdesc"].ToString();
}
where dtrJobDetails is a DataReader.

But now I am forced to return back a DataSet.. Is there anyway of
showing the individual column values returned from a DataSet in
individual labels like we do in a DataReader as above... I dont want
to show it in a DataGrid or a DataList...

Please help me.. I have been trying to figure this out since two
days..

Any help will be highly appreciated...
Thanks,
Sumaira

Nov 18 '05 #2
foreach (DataRow dr in ds.Tables[0])
{
l_shortjobdesc.Text = dr["shortjobdesc"].ToString();
}

note: you should avoid databinding with DataReaders as it may cause
blocking/scaling/resource problems, because databinding is slow, and occurs
after the query. passing datasets is a much better solution. it adds very
little overhead, but frees the query pipe quickly, releasing the locks.

-- bruce (sqlwork.com)
"Sumaira Ahmad" <su***********@gmail.com> wrote in message
news:16**************************@posting.google.c om...
Hi All

My Web Service is returning a DataSet. I realized that we cannot
return a DataReader.. Normally we can use a DataReader( when not
using Web services) and access it as below to assign values of columns
of returned rows to Labels in the client aplication such as:

while (dtrJobDetails.Read())
{
l_shortjobdesc.Text = dtrJobDetails["shortjobdesc"].ToString();
}
where dtrJobDetails is a DataReader.

But now I am forced to return back a DataSet.. Is there anyway of
showing the individual column values returned from a DataSet in
individual labels like we do in a DataReader as above... I dont want
to show it in a DataGrid or a DataList...

Please help me.. I have been trying to figure this out since two
days..

Any help will be highly appreciated...
Thanks,
Sumaira

Nov 18 '05 #3

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

Similar topics

1
by: Steven | last post by:
Hi all My problem is a little lengthy. But please help me. In my application, ADO.NET DataSet object is not getting constructed in the Web Service Web Method called by the Windows Application...
0
by: K Altsj? | last post by:
If passing a DataSet to a web method for update using ADO.NET and the update fails, the parameter list may get corrupt. The following code example consists of a Web Service and a consumer console...
1
by: yopy | last post by:
i have developed a web service which return dataset on dev machine, when i invoke the web service from the same machine it works fine, but when i deploy the web service to another machine, and...
3
by: James | last post by:
I need to create a C# web service that returns a recordset for an ASP classic applicaiton to consume. My problem is that so far the only thing that I have found I can return is a dataset using...
1
by: J. Askey | last post by:
I am implementing a web service and thought it may be a good idea to return a more complex class (which I have called 'ServiceResponse') in order to wrap the original return value along with two...
2
by: Anthony Biondo Jr | last post by:
I am trying to figure out the best way to return data through a web service. If the value is a single value I can just set it equal to the web service name. If I am returning a set of data I have...
2
by: David++ | last post by:
Hello list, I have built a project in VS2005 which includes a Web Service Web Site. On this server there is a Database. I have used the DataSet designer to link to this database and VS2005 has...
15
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 ...
1
by: Mike | last post by:
Hi, I have a WCF service that works perfectly. I added a new function (returning typed Dataset) and now, my service doesn't work anymore. I got a lot of "CODEGEN" warning inside the proxy file...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...

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.