Wednesday, March 21, 2012
Please Help me- Returning DataSet from a Web Service
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,
SumairaHi, 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" <sumaira.ahmad@.gmail.com> wrote in message
news:1627c5ae.0411011325.75864c65@.posting.google.com...
> 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
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" <sumaira.ahmad@.gmail.com> wrote in message
news:1627c5ae.0411011325.75864c65@.posting.google.com...
> 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
Please Help me- Returning DataSet from a Web Service
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,
SumairaHi, 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" <sumaira.ahmad@.gmail.com> wrote in message
news:1627c5ae.0411011325.75864c65@.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
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" <sumaira.ahmad@.gmail.com> wrote in message
news:1627c5ae.0411011325.75864c65@.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
Friday, March 16, 2012
please help me..... sms service
Hi evrybody, I am developing a website using asp.net with VB.net and access database.. the website is almost completed...but i have to finish one more small part. the website administrator should be able to send sms to the mobile number exist in the DB. i know that we should register to some sms provider which will supplement us with a user name and password.. I dont know how to implement it yet... and i have no clue about doing that.. I dont want to register to the sms provider yet since i am still working in the demo and i did not sell the website yet.. but i have this idea.. i hope if it will work. i have a DSL account in saudi.net (my.saudi.net.sa) company that provide me with username, pass, and numbers of free sms message and i am thinking to use them instead of creating an account in some provider. i hope if you help me in coding that to send sms message through my website using my account in saudinet. if my idea does not work, then please advice me for a provider and the code to send it if possible.. all what i can add here is that my work is stopped because of that and i will really appreciate any help here.. and please i am in hurry :)
Do you have console access to your site? If so create a queue table within your database as that your web application writes to this table. Then write a windows service to read this queue and call the SMS provider. Thus you can easily change the SMS provider.
Consuming such a web service is relatively easy, just import the wsdl to create a web reference and explore the resulting methods. It does help if the SMS provider gives you some sample code for their service. Code for other SMS providers will probably have a different interface and thus unlikely to be of help.
Hello,
This may be helpful to you,