is dataset empty

R

Rock

How can you tell if a dataset is empty or has no records?? In vb 6 you used
to be able to say if recordset.eof is true...
 
W

William \(Bill\) Vaughn

A DataSet can have 0-N DataTables. If there are no DataTables, there is no
data. If the Ds.Tables(0).Rows.Count is 0, there are no rows in the first
table. Each table in the Dataset can be checked in a similar fashion.

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
 
W

W.G. Ryan eMVP

DataSets have a Tables collection and you can check if a given table is
empty by looking at its Rows Collection

DataSetName.Tables[TableindexOrName].Rows.Count == 0;
 

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

Top