By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
464,640 Members | 1,108 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 464,640 IT Pros & Developers. It's quick & easy.

Oledb, Datasets And Null Rows

P: n/a
I'm trying to build a VB.NET function for an ASP .NET webservice whcih
returns certain data from a database.

I've got to the point where by i can retrieve data from a select query, but
i cannot deal with it if zero rows are returned. I'm convinced there must be
some way of dealing with a zero row dataset but i cannot for the love of god
find out what it is.

So far all i've managed to test is that a DataSet is returned (which is
always will be) using:

"If IsDBNull(dataSet.Table(0)) Then"

But i want to be able to deal with zero rows being returned, i.e. in the
case of a search script. At the moment, whenever Zero rows are returned I
get the error message "There is no row at position 0."

If you need any more information I'd be happy to provide this, Many thanks

Matt
Nov 21 '05 #1
Share this Question
Share on Google+
1 Reply

P: n/a
"Jumping Matt Flash" <jumpingmattflash@g-mail-.com> schrieb
I'm trying to build a VB.NET function for an ASP .NET webservice
whcih returns certain data from a database.

I've got to the point where by i can retrieve data from a select
query, but i cannot deal with it if zero rows are returned. I'm
convinced there must be some way of dealing with a zero row dataset
but i cannot for the love of god find out what it is.

So far all i've managed to test is that a DataSet is returned (which
is always will be) using:

"If IsDBNull(dataSet.Table(0)) Then"

But i want to be able to deal with zero rows being returned, i.e. in
the case of a search script. At the moment, whenever Zero rows are
returned I get the error message "There is no row at position 0."

If you need any more information I'd be happy to provide this, Many
thanks

if dataSet.tables(0).rows.count = 0 then

Armin
Nov 21 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.