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

records affected

I have datareader. I filled it with data and also if I use rdr.has rows it
returns True.

If I use rdr.read and scroll over it, it works.

But if I wants to finds the records affected I always get -1.

rdr.RecordsAffected=-1

Why?

Regards,
Simon
Nov 19 '05 #1
2 1616
Quote from .NET Documentation
"The number of rows changed, inserted, or deleted; 0 if no rows were
affected or the statement failed; and -1 for SELECT statements."

I believe that DataReader does not return recordcount because it provides
forward-only reading through result set.

Nov 19 '05 #2
"Jouni Karppinen" <Jo************@discussions.microsoft.com> wrote in
message news:08**********************************@microsof t.com...
Quote from .NET Documentation
"The number of rows changed, inserted, or deleted; 0 if no rows were
affected or the statement failed; and -1 for SELECT statements."

I believe that DataReader does not return recordcount because it provides
forward-only reading through result set.


Correct. The DataReader has no notion of the number of records it contains -
only that it does or does not contain any records.
Nov 19 '05 #3

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

Similar topics

5
by: Rich Protzel | last post by:
Hello, If I run an action SP from MS Access using ADO: ... cmd.execute where the SP is something like Create... Update tbl1 set fld1 = 'something' where... how can I retrive the count of...
12
by: Jeff North | last post by:
I'm stumped and my brains are fried!!!! I have the following data +-------+------------------------------+------------+ | resID | FLEName | VersionNbr |...
1
by: anonieko | last post by:
> This is a common problem with some solution > > /*********************************************************************************** * * Problem: * Determine the Duplicated Records in a...
2
by: Rich | last post by:
Hello, Is there a way to capture the Records Affected count when performing a table Update on a Sql Server table using a DataAdapter? How is this done? Thanks, Rich
1
by: Miriam | last post by:
Hello, I got the error "Concurrency violation: the UpdateCommand affected 0 records" while updating some records in the Windows Application. I am using VB.net in VS 2003 and the backend is...
2
by: Dave | last post by:
I'm in need of a little sql help. How do i get a list of ids from one table that do not have the same ids in another table? I hope that makes sense.
7
by: Lewe22 | last post by:
I am performing a series of updates from a command button on an access form. I want to record the number of records affected for each update transaction. I have simplified some code.. Private...
4
by: Neil | last post by:
I previously posted about data shifting between records in my Access 2000 MDB with a SQL Server 7 back end, using ODBC linked tables. Every once in a while, data from one record mysteriously...
4
by: Neil | last post by:
Is there a problem with stability when one uses too many text (memo) fields? I'm having a problem with data from one record occasionally ending up in another record, though apparently not through...
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
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...

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.