473,396 Members | 1,836 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,396 software developers and data experts.

Check for empty sqldatareader

Hi,

Could anybody suggest a way of checking for an empty datareader, without
using Read()?

Thanks
Nov 19 '05 #1
4 2212
if rdr.HasRows then
...
end if

Nov 19 '05 #2
sqldatareader.HasRows

Elton Wang
el********@hotmail.com
"Sosh123" wrote:
Hi,

Could anybody suggest a way of checking for an empty datareader, without
using Read()?

Thanks

Nov 19 '05 #3
Why would you not want to use dr.Read()?

bill

"Sosh123" <so**@so9sh.com> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
Hi,

Could anybody suggest a way of checking for an empty datareader, without
using Read()?

Thanks

Nov 19 '05 #4
Becuase it would move the row cursor on one. Looks like the HasRows
property is just the ticket though. Thanks.

William F. Robertson, Jr. wrote:
Why would you not want to use dr.Read()?

bill


Nov 19 '05 #5

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

Similar topics

3
by: Ricola ! | last post by:
Why do I say: SqlDataReader dr; instead of SqlDataReader dr = new SqlDataReader();
7
by: Franck Diastein | last post by:
Hi, when I call ExportData I have this error: Invalid attempt to Read when reader is closed. Telling me that there's a problem with this line: while(_dataR.Read()){ Code:...
3
by: Neil Guyette | last post by:
Hello, Everyone, I'm trying to find information on how to populate a combo box using a SqlDataReader. I want to be able to set the value of the combo's value property different then the...
1
by: Arvind P Rangan | last post by:
Hi All, How do you get all the values of a sqldatareader if it contains multiple resultset. Using sqldatareader.nextresult and sqldatareader.read e.g. While sqldatareader.read ' If not...
3
by: D. Shane Fowlkes | last post by:
(still a .NET newbie) I have a chunk of code in a Page_Load routine that pulls data from a SQL Server table. The Select statement looks for any "events" scheduled for today. Then my IF...
1
by: RJN | last post by:
Hi I'm getting the General Network error, though not consistently. Stack trace is below. Any fix for this? at System.Data.SqlClient.SqlConnection.OnError(SqlException exception,...
13
by: lithoman | last post by:
I'm stumped here. I run the procedure Batch_Select against the database with @ID=18 and I get the expected data. When it loads into a SqlDataReader, it gets messed up somehow. Initially, after the...
2
by: fniles | last post by:
I am using VB.NET 2005 and SQLDataReader. How can I check the data type of a field in the DataReader ? Thank you. Dim cmdSQL As SqlClient.SqlCommand Dim drSQL As SqlClient.SqlDataReader sSQL...
0
by: readnlearn | last post by:
hai, i have written this below code for displaying captcha image whenever i entered incorrect uname,password in login page. for that i disable the controls of captcha like textbox,labels,button and...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.