473,790 Members | 2,850 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Is there a .Net CF equivalent of the DataReader.HasR ows method?

Is there a .Net Compact Framework equivalent in the system.data.sql serverce
namespace of the .Net Framework system.data.sql client DataReader object's
"Has.Rows" method?

For example:

SqlDataReader rdr = new cmd.ExecuteRead er();
if (rdr.HasRows)
{
// do something
}

thanks,

Nov 16 '05 #1
1 4856
Hi Charlie,

There is no "HasRows" support in .NET Compact Framework.
You can use the "Read" property of the SqlDataReader. As it will return a
boolean value it functions the same as that of "HasRows."

Instead of

SqlDataReader rdr = new cmd.ExecuteRead er();
if (rdr.HasRows)
{
// do something
}

you can use

if (rdr.Read)
{
// do something
}

Thank you

"charliewes t" wrote:
Is there a .Net Compact Framework equivalent in the system.data.sql serverce
namespace of the .Net Framework system.data.sql client DataReader object's
"Has.Rows" method?

For example:

SqlDataReader rdr = new cmd.ExecuteRead er();
if (rdr.HasRows)
{
// do something
}

thanks,

Nov 17 '05 #2

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

Similar topics

5
2310
by: Catalin Porancea | last post by:
Whenever I try this: ____________________________________________________________________ Dim cmd_sp_payments As SqlCommand = New SqlCommand("sp_payments", con) cmd_sp_payments.CommandType = CommandType.StoredProcedure Dim CustID As SqlParameter = cmd_sp_payments.Parameters.Add("@cust_id", SqlDbType.Text) CustID.Value = strCustID Dim myReader As SqlDataReader = cmd_sp_payments.ExecuteReader() If myReader.HasRows Then
5
1962
by: Scott Shuster | last post by:
Hi, I'm having some strange problems in VS employing a DataReader. Here's a small snippet of the code: .... objDR = objCMD.ExecuteReader() If objDR.Read() Then (true stuff) Else
1
3092
by: Brent | last post by:
I'm having a hard time wrapping my head around how to build a multi-dimensional array of n length out of a DataReader loop. Take this pseudo-code: ======================================= public string get_array(string sql) { //create db connection & open
9
10254
by: Paul | last post by:
Does anyone have any insight on how I can get a count of the records returned after executing an ExecuteReader command? Something similar to the ..RecordCount property in Classic ASP?
3
21499
by: tjonsek | last post by:
Albeit new to VB.NET, I've done this several times before, but today I've run into an interesting problem. I am trying to loop through a datareader and display the data in a spreadsheet. So far, I only get 1 row to display. (I know it has multiple rows) Here's the code for the loop: xlRow = "4" With reader .Read() Do While .HasRows
6
8476
by: dew | last post by:
How do I get the number of rows a datareader has? I can tell HasRows, but not how many. Thanks.
3
2494
by: Carlos Lozano | last post by:
Hello, I am having a problem getting the selectedValue from a dropdownlist that is populated with a dataReader and just can't see the problem. I did the following: dim dr as DataReader dr = DataReader(sSQLcmd) Me.DropDownList1.DataSource = dr
3
9498
by: RSH | last post by:
Hi, I have a situation where I have two datareaders, and I want to make sure any given field from Datareader A exists in Datareader B before I can do anything with that column. I tried the code below but I get an exception thrown because the column doesn't exist in Datareader B. I'm not opposed to using another method but the same thing happened when using a Dataset. How do I do this??
2
3179
by: rn5a | last post by:
The following code resides in a VB class file name GetOrder.vb (this class file exists in the App_Code directory): Namespace Shop Public Class Orders Public Function ViewOrder(ByVal UserID As Integer, ByVal OrderID As Integer) As SqlDataAdapter Dim sqlDapter As SqlDataAdapter Dim sqlConn As SqlConnection
0
9666
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
9512
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10200
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...
0
9986
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7530
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
6769
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
5551
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4094
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
3
2909
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.