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

Datareader empty

P: n/a
Hello all,

I'd like to know if it is possible to create an empty DataReader (not
Nothing, but a DataReader with no rows in it)

An example

Try
dr = cmd.ExecuteReader()
Catch Ex as Exception
'Manage the exception and assigning an empty DataReader to dr
....
End Try

While dr.Read
.....
End While

In this way, when the dr.Read occurs no exception arises (while if dr is
nothing the exception is thrown on the dr.Read)

Thanks
Claudio
Nov 20 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.