is gridview empty?

Discussion in 'ASP .Net' started by Mr. SweatyFinger, Jan 19, 2007.

  1. how do i tell if i got back records (in code)
    thanks
     
    Mr. SweatyFinger, Jan 19, 2007
    #1
    1. Advertising

  2. Mr. SweatyFinger

    Aidy Guest

    What structure are you getting your data back in? For a SqlDataReader use
    the HasRows property. For a DataTable use Rows.Count.

    "Mr. SweatyFinger" <> wrote in message
    news:%...
    > how do i tell if i got back records (in code)
    > thanks
    >
     
    Aidy, Jan 19, 2007
    #2
    1. Advertising

  3. EmptyDataTemplate can be useful in the GridView when there are no rows,
    otherwise you can normally use ds.Tables("myTable").Rows.Count

    --
    --
    Regards

    John Timney (MVP)
    VISIT MY WEBSITE:
    http://www.johntimney.com
    http://www.johntimney.com/blog


    "Mr. SweatyFinger" <> wrote in message
    news:%...
    > how do i tell if i got back records (in code)
    > thanks
    >
     
    John Timney \(MVP\), Jan 19, 2007
    #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. John

    empty/non-empty element

    John, Jul 15, 2003, in forum: XML
    Replies:
    1
    Views:
    1,035
    Klaus Johannes Rusch
    Jul 16, 2003
  2. Lukas
    Replies:
    3
    Views:
    816
    spiff
    Nov 10, 2005
  3. Marcia Hon

    Check if a directory is empty and empty it

    Marcia Hon, Feb 8, 2004, in forum: C Programming
    Replies:
    8
    Views:
    578
    Dave Thompson
    Feb 14, 2004
  4. Brian Roberts

    empty lists vs empty generators

    Brian Roberts, May 3, 2005, in forum: Python
    Replies:
    12
    Views:
    663
    Jeremy Bowers
    May 4, 2005
  5. Savvoulidis Iordanis

    Empty gridview cells and checking for empty string

    Savvoulidis Iordanis, Sep 5, 2008, in forum: ASP .Net
    Replies:
    1
    Views:
    524
    Savvoulidis Iordanis
    Sep 5, 2008
Loading...

Share This Page