Oledb, Datasets And Null Rows

J

Jumping Matt Flash

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
 
A

Armin Zingler

Jumping Matt Flash said:
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
 

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

Merging Datasets 7
Having a database issue 0
Manipulating Datasets 9
datasets 1
Datasets and Adapter Updates 3
datasets & xmlhttp? 4
changing a datasets contents 5
Using DataSets 7

Top