Hi,
Thanks for that. Although I'm not sure if the syntax
int rowCount = myDataSet.Tables[0].Rows.Count
is correct. The way I found to get the number of rows in the first table of
a dataset was to iterate through then and count them in a
For ... Each loop
would be interested in a way to do this in one line similar to what you had
above.
cheers
martin.
"Hermit Dave" <he************@CAPS.AND.DOTS.hotmail.com> wrote in message
news:OK**************@TK2MSFTNGP11.phx.gbl...
a dataset always contains datatable(s)....
if your dataset has only one datatable (ie results of one select query)
all you have to do is something like this
int rowCount = myDataSet.Tables[0].Rows.Count
check the count and see if its zero... ie no records found..
--
Regards,
HD
"martin" <ma***************@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl... Hi,
I am having trouble determining if my dataset is empty.
I have function that populates a dataset from a database and then
retuens it. If the database contains no data then the dataset will be completely
empty, and then when I go to databind() it to a combo box and error will
be throw.
What I whould like to do is check the dataset from code to see if it is
empty.
can anybody please point me in the direction of how to do this.
many thanks in advance.
cheers
martin