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

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

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
}

thanks,

Nov 16 '05 #1
1 4787
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.ExecuteReader();
if (rdr.HasRows)
{
// do something
}

you can use

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

Thank you

"charliewest" wrote:
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
}

thanks,

Nov 17 '05 #2

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

Similar topics

5
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 =...
5
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
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...
9
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
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...
6
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
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...
3
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...
2
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...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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...

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.