How do you determine if a datatable is empty?


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: How do you determine if a datatable is empty?

  1. #1
    Jeff Guest

    How do you determine if a datatable is empty?


    I have a datagrid in VB.NET that is filled with information given a set of
    search criteria. After the search I want to check the datatable before loading
    it into the datagrid to see if the datatable is empty? How can I check this?

    Jeff

  2. #2
    Paul Mc Guest

    Re: How do you determine if a datatable is empty?


    G'day Jeff.

    >I want to check the datatable before loading
    >it into the datagrid to see if the datatable is empty? How can I check
    >this?


    Well, two ways.

    If you are loading the table with DataAdapter.Fill, then this returns the
    number of rows returned.

    Otherwise, you can do: MyDataTable.Rows.Count

    HTH,
    Cheers,
    Paul


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center