SCM

[#1000726] RecordsAffected property

View Trackers | Bugs | Download .csv | Monitor

Date:
2006-09-01 08:43
Priority:
3
State:
Open
Submitted by:
Nobody
Assigned to:
Nobody (None)
Npgsql Version:
None
Category:
Group:
Resolution:
None
Summary:
RecordsAffected property

Detailed description
Hi,

When I execute many insertions, many deletions or many updates in the same command, the RecordsAffected property returned always 1.

The commands are well executed but the RecordsAffected property does returned the real number of affected records.

Best regards,

--
Nadi

Followup

Message
Date: 2008-08-11 01:32
Sender: Francisco Figueiredo jr.


Hi,

Can you check if you still get this problem with latest Npgsql?

Thanks in advance.
Date: 2006-09-12 12:25
Sender: Josh Cooley

Hi Nadi,

Yes I did mean NextResult. Thanks for your testing. I setup a SqlClient test and found that it behaves the way you describe the ODBCDataReader. I still need to do some more testing to understand the exact behavior of other db clients.

Josh
Date: 2006-09-11 09:59
Sender: Nobody

Josh,

It is right that the MSDN documentation is not clear but the behavior of ODBCDataReader and NpgSQLDataReader are different at that point.
If the requests contain only updates, insertions and deletions (and no selects), the NextResult method of ODBCDataReader returns False.

More, I have just tested what you wrote but the behavior becomes really strange :
NextResult method of NpgSQLDataReader returns once True for three updates.
RecordsAffected value does not change.

(I guess that you were talking about NextResult instead of MoveNext).

I hope that I understand what you mean and I thank you for your answers.

Best regards,

--
Nadi.
Date: 2006-09-11 02:08
Sender: Josh Cooley

Nadi,

You should have the number of records affected on each result set by calling MoveNext. The msdn documentation isn't clear, but the NpgsqlDataReader.RecordsAffected value is the number of records affected by a single statement. Each call to MoveNext will change the value of RecordsAffected to match the value that is appropriate for the matching statement.

Josh

Attached Files:

Changes:

No Changes Have Been Made to This Item

Powered By FusionForge