How to check if a dataset is empty?

  • Thread starter Thread starter Shapper
  • Start date Start date
S

Shapper

Hello,

I have am connecting a datagrid to a dataset:
dgProducts.DataSource = dsProducts()

dsProducts is a function which returns a dataset.

How can I detect if the dataset which is being returned is empty?

Thanks,
Miguel
 
You can use dsProducts().Tables.Count to check how many tables are in the
returned dataset. Alternatively, if you want to check if any rows are
returned in a specific table, you could use something like
dsProduts.Tables[0].Rows.Count.

Mun
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Back
Top