Re: parse data question

Discussion in 'ASP .Net' started by Karl, Aug 26, 2004.

  1. Karl

    Karl Guest

    I'm not sure what kind of form your web service is returning the data in.
    I'll assume it's a dataset/datable. You can either use the SELECT command
    of a datatable, or the RowFilter or a Dataview...one returns an array of
    DataRows which is great for simply looping...and the Dataview is ideal for
    binding.

    Dim rows() as DataRow = ds.tables(0).Select("Type = 1")
    dim dv as DataView = ds.tables(0).DefaultView
    dv.RowFilter = "Type = 1"


    Karl

    "IGotYourDotNet" <> wrote in message
    news:...
    > I wrote a web service that connects to the db and executes all the SP's

    and i
    > have all the data being displayed in grids, - easy. Now I'm at a brain

    freeze.
    >
    > I'm calling a method in the web service to execute a SP and when the data

    is
    > returned I need to parse out the only certain dataitems from the dataset
    > being returned from the web service.
    > Any ideas on how to do that?
    >
    Karl, Aug 26, 2004
    #1
    1. Advertising

  2. Karl

    Karl Guest

    Oh, you don't want to filter the rows, you want to filter the columns. I
    imagine you are using a datalist with AutoGenerateColumns=true (the
    default). You could delete the columns from the dataset, but a better
    alternative would be to set the autogeneratecolumns to false and bind it
    yourself

    Something like:
    <asp:DataGrid ID="list" Runat="server" AutoGenerateColumns="False">
    <Columns>
    <asp:BoundColumn datafield="make" />
    <asp:BoundColumn datafield="model" />
    </Columns>
    </asp:DataGrid>

    or use a datalist/repeater and do something similar with the ItemTemplate.

    Karl


    "IGotYourDotNet" <> wrote in message
    news:...
    > the service is returning a dataset such as
    >
    > <car>
    > <make>Chevy</make>
    > <model>Corvette</model>
    > <year>2005</year>
    > <color>red</red>
    > </car>
    >
    > I would only want make and model to display on my page
    >
    >
    > "Karl" wrote:
    >
    > > I'm not sure what kind of form your web service is returning the data

    in.
    > > I'll assume it's a dataset/datable. You can either use the SELECT

    command
    > > of a datatable, or the RowFilter or a Dataview...one returns an array of
    > > DataRows which is great for simply looping...and the Dataview is ideal

    for
    > > binding.
    > >
    > > Dim rows() as DataRow = ds.tables(0).Select("Type = 1")
    > > dim dv as DataView = ds.tables(0).DefaultView
    > > dv.RowFilter = "Type = 1"
    > >
    > >
    > > Karl
    > >
    > > "IGotYourDotNet" <> wrote in

    message
    > > news:...
    > > > I wrote a web service that connects to the db and executes all the

    SP's
    > > and i
    > > > have all the data being displayed in grids, - easy. Now I'm at a brain

    > > freeze.
    > > >
    > > > I'm calling a method in the web service to execute a SP and when the

    data
    > > is
    > > > returned I need to parse out the only certain dataitems from the

    dataset
    > > > being returned from the web service.
    > > > Any ideas on how to do that?
    > > >

    > >
    > >
    > >
    Karl, Aug 26, 2004
    #2
    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. Weston Weems
    Replies:
    0
    Views:
    406
    Weston Weems
    Aug 27, 2004
  2. David
    Replies:
    0
    Views:
    570
    David
    May 27, 2004
  3. Replies:
    19
    Views:
    1,120
    Daniel Vallstrom
    Mar 15, 2005
  4. 7stud --

    optparse: parse v. parse! ??

    7stud --, Feb 20, 2008, in forum: Ruby
    Replies:
    3
    Views:
    183
    7stud --
    Feb 20, 2008
  5. Troll
    Replies:
    3
    Views:
    150
    dan baker
    Nov 1, 2004
Loading...

Share This Page