remove data value from dataset

Discussion in 'ASP .Net' started by =?Utf-8?B?Q1NoYXJwZ3V5?=, Aug 17, 2006.

  1. I have a dataset that is populating my GridView, BUT there are values in the
    dataset that I do not need to show in my grid, This is a datavalue not a row
    or column value, so how can I exclude this value from my dataset and not show
    it in my grid?

    example:
    DataSet values
    <CarMake>BMW</CarMake>
    <CarMake>Mercedes</CarMake>
    <CarMake>Ford</CarMake>
    <CarMake>Chevy</CarMake>
    <CarMake>Used</CarMake>

    If <CarMake>Used</CarMake> exists I do not want to show it in my grid.
    I cant change the stored procedure due to that value is used by another
    application. So that option isn't happening. Is there any other way to
    filter/hide that value?
    =?Utf-8?B?Q1NoYXJwZ3V5?=, Aug 17, 2006
    #1
    1. Advertising

  2. I figured it out after I hit the send button.

    DataView dv = new DataView(ds.tables[0]);
    dv.RowFilter = "CarMake <> 'Used'";


    "CSharpguy" wrote:

    > I have a dataset that is populating my GridView, BUT there are values in the
    > dataset that I do not need to show in my grid, This is a datavalue not a row
    > or column value, so how can I exclude this value from my dataset and not show
    > it in my grid?
    >
    > example:
    > DataSet values
    > <CarMake>BMW</CarMake>
    > <CarMake>Mercedes</CarMake>
    > <CarMake>Ford</CarMake>
    > <CarMake>Chevy</CarMake>
    > <CarMake>Used</CarMake>
    >
    > If <CarMake>Used</CarMake> exists I do not want to show it in my grid.
    > I cant change the stored procedure due to that value is used by another
    > application. So that option isn't happening. Is there any other way to
    > filter/hide that value?
    >
    =?Utf-8?B?Q1NoYXJwZ3V5?=, Aug 17, 2006
    #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. LunchBox
    Replies:
    0
    Views:
    770
    LunchBox
    Dec 4, 2003
  2. Simon-Pierre  Jarry
    Replies:
    2
    Views:
    2,333
    Henrik
    Aug 10, 2005
  3. tshad
    Replies:
    6
    Views:
    21,426
    tshad
    Aug 8, 2006
  4. LunchBox

    Remove row with null value from DataSet??

    LunchBox, Dec 4, 2003, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    129
    LunchBox
    Dec 4, 2003
  5. Replies:
    1
    Views:
    151
    Vedran SubotiƦ
    Sep 7, 2005
Loading...

Share This Page