By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,847 Members | 2,392 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,847 IT Pros & Developers. It's quick & easy.

Please Help me- Returning DataSet from a Web Service

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.