How to check if a dataset is empty?

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
 
M

Munsifali Rashid

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

Members online

Forum statistics

Threads
474,433
Messages
2,571,683
Members
48,796
Latest member
Greg L.

Latest Threads

Top