473,669 Members | 2,386 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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=u2ct0sgz CHA.640%40TK2MS FTNGP12&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 1701
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.co m> 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=u2ct0sgz CHA.640%40TK2MS FTNGP12&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.H asRows Then
DataGrid1.DataS ource = sqlDataReader
DataGrid1.DataB ind()
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.co m> 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=u2ct0sgz CHA.640%40TK2MS FTNGP12&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
2519
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. The scenario is this: 1.) Set up SqlConnection and SqlCommand 2.) Set SqlDataReader equal to the return value from SqlCommand.ExecuteReader
1
4838
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: SqlDataReader rdr = new cmd.ExecuteReader(); if (rdr.HasRows) { // do something
2
15578
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 cmdCheckName="SELECT Count(Quiz_Name) FROM Quiz WHERE Quiz_Name = '"+valName+"' "; SqlCommand cmdCheck = new SqlCommand(cmdCheckName, sqlConnection1); SqlDataReader drCheckName =
1
2704
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 = comboBox2.Text; objreturnst.Parameters.Value = comboBox1.Text; oleDbConnection1.Open();
1
2250
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 for 1.0.3705 and 1.1. My documentation is old too because HasRows doesn't exist. csc.exe says .net Framework 1.0.3705. So what should I do? Uninstall 1.0.3705 and reinstall 1.1? Or is there an entry in my web.config or machine.config to
2
3067
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! Thanks in advance for the assistance. Line 18: MyConn.Open() Line 19: objDR=Cmd.ExecuteReader(system.data.CommandBehavior.CloseConnection)
2
9961
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 a Reader, but I can't use a Reader in this particular instance... Thanks! Jack
1
2357
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 Recordcount? Thanks for your help in advance!!!
0
1512
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. however, if i don't want a repeat of information and the system checks to see if the user is already in the database i get an error. it's either i get the error message "The user name you entered is already on file." all the time or if i put "Not...
0
8465
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8895
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8809
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8588
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7407
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6210
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5682
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4206
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2797
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.