473,378 Members | 1,389 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Datareader empty

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
0 1032

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Mike | last post by:
I am trying to use a datareader to retrieve data and set some properties. I am getting a "Specified method is not supported" error on Line xxx. The data base is Oracle 9i and the field is a...
5
by: Rob Wire | last post by:
For the code below, how could I add an item in the drop down lists for both company and location to be an "All" selection that would send to the stored proc. spRptAttachments a value of "%" so...
6
by: sri_san | last post by:
Hello, I have a bunch of similar functions as listed below. This one returns a string but lot of functions return datareader. I close the reader, the connection and set it to nothing but the...
3
by: tshad | last post by:
I am trying to set up a class to handle my database accesses. I can't seem to figure out how to get the return value from my dataReader from these routines (most of which I got elsewhere). They...
1
by: patrick | last post by:
newbie-question i have a table with 2 rows and 4 columns. i'm using a datareader for performance reason. now i would like to assign to a textfield a value from this datareader, i.e if value...
1
by: js | last post by:
I am using executeReader to get a SqlDataReader as in my code below. The SqlDataReader contains two tables. I am trying to bind each table to its respective dropdown list control. Thanks. ...
3
by: Froefel | last post by:
Hi group I am creating a web application that uses a simple DAL as an ObjectDataSource. To retrieve data from the database, I use a DataReader object from which I then assign the various fields...
3
by: saynords | last post by:
Hi I need to check if my datareader is empty and if so do a response.write. OracleDataReader reader = cmd.ExecuteReader(); dtgridSearch.DataSource = reader; I tried if (reader.read) but that...
5
by: axapta | last post by:
Hi Group, How can I overcome the issue of null values in a datareader. I keep getting the dbnull error when I try to assign a null value to a text box. TIA
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.