Please Help me- Returning DataSet from a Web Service

Discussion in 'ASP .Net' started by Sumaira Ahmad, Nov 1, 2004.

  1. 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
     
    Sumaira Ahmad, Nov 1, 2004
    #1
    1. Advertising

  2. Sumaira Ahmad

    John Guest

    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" <> wrote in message
    news:...
    > 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
     
    John, Nov 2, 2004
    #2
    1. Advertising

  3. Sumaira Ahmad

    bruce barker Guest

    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" <> wrote in message
    news:...
    > 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
     
    bruce barker, Nov 2, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Sumaira Ahmad

    Please Help me- Returning DataSet from a Web Service

    Sumaira Ahmad, Nov 1, 2004, in forum: ASP .Net Datagrid Control
    Replies:
    0
    Views:
    114
    Sumaira Ahmad
    Nov 1, 2004
  2. Sumaira Ahmad

    Please Help me- Returning DataSet from a Web Service

    Sumaira Ahmad, Nov 1, 2004, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    137
    Ken Cox [Microsoft MVP]
    Nov 3, 2004
  3. Curly
    Replies:
    0
    Views:
    199
    Curly
    Aug 19, 2003
  4. Ketchup
    Replies:
    1
    Views:
    250
    Jan Tielens
    May 25, 2004
  5. Sumaira Ahmad

    Please Help me- Returning DataSet from a Web Service

    Sumaira Ahmad, Nov 1, 2004, in forum: ASP .Net Web Services
    Replies:
    1
    Views:
    110
Loading...

Share This Page