Select Distinct DataGrid

Discussion in 'ASP .Net' started by =?Utf-8?B?YmVub2l0?=, Oct 14, 2005.

  1. I have created a Typed DataSet that renders about 150 records.

    I put these into a datagrid that obviously shows me 150 records.

    My problem is now only one column is different most of the time.

    Is there a (easy) way to get from this situation

    ID Title Extra Other Date
    01 myTitle extra other 15-02-2006
    01 myTitle extra other 16-02-2006
    01 myTitle extra other 17-02-2006
    01 myTitle extra other 18-02-2006
    01 myTitle extra other 19-02-2006
    02 myTitle2 extra2 other 15-02-2006
    02 myTitle2 extra2 other 16-02-2006
    02 myTitle2 extra2 other 17-02-2006
    02 myTitle2 extra2 other 18-02-2006
    02 myTitle2 extra2 other 19-02-2006

    to something like this
    01 myTitle extra other details
    02 myTitle2 extra2 other details

    One problem is that these dates are one of the search items
    in my SQl is writtten
    WHERE Date BETWEEN date01 AND date02

    thx
     
    =?Utf-8?B?YmVub2l0?=, Oct 14, 2005
    #1
    1. Advertising

  2. benoit wrote:
    > One problem is that these dates are one of the search items
    > in my SQl is writtten
    > WHERE Date BETWEEN date01 AND date02


    Could you not use something like:

    SELECT DISTINCT(ID), Title, Extra, Other, Date
    FROM tablename
    WHERE Date BETWEEN date01 AND date02

    ?
     
    Leon Mayne [MVP], Oct 14, 2005
    #2
    1. Advertising

  3. Yes but you cannot use select distinct in a DataView
    from a Typed DataSet

    "Leon Mayne [MVP]" wrote:

    > benoit wrote:
    > > One problem is that these dates are one of the search items
    > > in my SQl is writtten
    > > WHERE Date BETWEEN date01 AND date02

    >
    > Could you not use something like:
    >
    > SELECT DISTINCT(ID), Title, Extra, Other, Date
    > FROM tablename
    > WHERE Date BETWEEN date01 AND date02
    >
    > ?
    >
    >
    >
     
    =?Utf-8?B?YmVub2l0?=, Oct 14, 2005
    #3
  4. Leon Mayne [MVP], Oct 14, 2005
    #4
  5. ok thanks
    That's a start !
    I''l try to figure out how to retrieve several columns with itinstead of the
    single one in the example


    "Leon Mayne [MVP]" wrote:

    > benoit wrote:
    > > Yes but you cannot use select distinct in a DataView
    > > from a Typed DataSet

    >
    > OK, does this help?
    > http://support.microsoft.com/default.aspx?scid=kb;en-us;326176
    >
    >
    >
     
    =?Utf-8?B?YmVub2l0?=, Oct 14, 2005
    #5
    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. will
    Replies:
    1
    Views:
    1,172
    Pavel Lepin
    Aug 15, 2007
  2. Hicham Mouline
    Replies:
    1
    Views:
    423
    Kai-Uwe Bux
    Apr 11, 2010
  3. andrewmrichards

    XPATH equivalent of SELECT DISTINCT

    andrewmrichards, Dec 2, 2010, in forum: XML
    Replies:
    2
    Views:
    3,447
    Martin Honnen
    Dec 3, 2010
  4. Marco Alting

    SELECT DISTINCT from two tables

    Marco Alting, Jul 30, 2003, in forum: ASP General
    Replies:
    4
    Views:
    177
    Phill. W
    Jul 31, 2003
  5. mianiro

    Distinct and Top in Select

    mianiro, Jan 2, 2007, in forum: ASP General
    Replies:
    1
    Views:
    158
    Bob Barrows [MVP]
    Jan 2, 2007
Loading...

Share This Page