473,398 Members | 2,380 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,398 software developers and data experts.

HasRows property

I am having the same problem as the person in this thread mentions:
http://groups.google.be/groups?q=asp...hasrows&hl=nl&
lr=&ie=UTF-8&oe=UTF-8&selm=u2ct0sgzCHA.640%40TK2MSFTNGP12&rnum=1

Somebody says that framework 1.1 will have a HasRows property but this
doesn't seem true. Is there such a property and if not is there a good
solution yet?
--
Kind regards,

Stijn Verrept.
Nov 18 '05 #1
2 1693
The property exists. It is included in the datareader object.

Best Regards.
Stefano Mostarda
Rome Italy
"Stijn Verrept" <stijn@no_s.p.a.n.entrysoft.com> ha scritto nel messaggio
news:40**********************@news.skynet.be...
I am having the same problem as the person in this thread mentions:
http://groups.google.be/groups?q=asp...hasrows&hl=nl&
lr=&ie=UTF-8&oe=UTF-8&selm=u2ct0sgzCHA.640%40TK2MSFTNGP12&rnum=1

Somebody says that framework 1.1 will have a HasRows property but this
doesn't seem true. Is there such a property and if not is there a good
solution yet?
--
Kind regards,

Stijn Verrept.

Nov 18 '05 #2
Yes, there is such property but as was said in the reply, it addresses the
problem but doesn't remove it e.g you still need to do the check,.

You could have a check like this:

If sqlDataReader.HasRows Then
DataGrid1.DataSource = sqlDataReader
DataGrid1.DataBind()
Else
Label1.Text = "No records found"
End If

--
Teemu Keiski
MCP, Microsoft MVP (ASP.NET), AspInsiders member
ASP.NET Forum Moderator, AspAlliance Columnist

"Stijn Verrept" <stijn@no_s.p.a.n.entrysoft.com> wrote in message
news:40**********************@news.skynet.be...
I am having the same problem as the person in this thread mentions:
http://groups.google.be/groups?q=asp...hasrows&hl=nl&
lr=&ie=UTF-8&oe=UTF-8&selm=u2ct0sgzCHA.640%40TK2MSFTNGP12&rnum=1

Somebody says that framework 1.1 will have a HasRows property but this
doesn't seem true. Is there such a property and if not is there a good
solution yet?
--
Kind regards,

Stijn Verrept.

Nov 18 '05 #3

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

Similar topics

0
by: James Hokes | last post by:
Hi All, We're using the 1.1. Framework against SQL Server 2000, and are having a strange issue where we don't get errors back from the stored procedure, i.e. the exception never gets thrown. ...
1
by: charliewest | last post by:
Is there a .Net Compact Framework equivalent in the system.data.sqlserverce namespace of the .Net Framework system.data.sqlclient DataReader object's "Has.Rows" method? For example: ...
2
by: gjtired | last post by:
Hi, I can't figure out why my HasRows code is always true. Below is a snippet of my code. sqlConnection1.Open(); //Check that quiz name is not a duplicate during the Create(0)task string...
1
by: Claudia Fong | last post by:
Hi, I'm using the oleDbDataReader HasRows properties to detect wheter my table contains a record with the parameter below: oleDbConnection1.Close(); objreturnst.Parameters.Value =...
1
by: AJ | last post by:
I'm trying to use this property but the compiler doesn't understand HasRows and the documentation says I need 1.1 of the framework and looking in my "add or remove programs" I have the framework...
2
by: TN Bella | last post by:
PLEASE HELP!! I am so far behind....and it doesn't help that I am learning all this stuff. I am using .net framework 1.0 from WebMatrix. These parameters get me all confused...someone please help!...
2
by: Jack Black | last post by:
Hi, all! What is the method for either testing for rows in a recordset or returning the number of rows in a recordset from a populated Adapter or from a DataSet? I know you can use HasRows with...
1
by: Rick | last post by:
I have found the HasRows member of the OleDbConnection. This is very nice to tell me if I have any data coming but what if I want to see how many rows of data I have. Is there a similar member to...
0
by: ashes | last post by:
Hi, i created a register form on a website. The information from the form has to go in the customer table in a database in MS Access. the information is going into the table perfectly. ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.