TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
rocket
NA
16
0
using .RecordsAffected, C#
Dec 4 2008 10:54 AM
Hi, I am using a C# application that interacts with a TSQL stored procedure.
The problem is that my SqlDataReader property .RecordsAffected always returns -1 regardless of whatever kind of select, update, or delete query I run.
Here is my relevant code:
SqlDataReader myReader = null;
SqlCommand command = new SqlCommand("CSP_CT_233", myConnection);
myReader = command.ExecuteReader();
while (myReader.Read())
{
blah blah blah //this stuff works fine
}
myReader.Close();
Console.Writeline(
myReader.RecordsAffected.ToString()
);
Reply
Answers (
8
)
Help with datagridview
Operation is not valid due to the current state of the object.