SCM

[#1010788] NpgsqlCommand and UpdatedRowSource property

View Trackers | Bugs | Download .csv | Monitor

Date:
2010-04-08 20:35
Priority:
3
State:
Open
Submitted by:
Peter Figuli (peposh)
Assigned to:
Nobody (None)
Npgsql Version:
2.0.8
Category:
Group:
Resolution:
None
Summary:
NpgsqlCommand and UpdatedRowSource property

Detailed description
Hello,

NpgsqlCommand has only readonly property UpdatedRowSource always returning UpdateRowSource.Both value.

The real problem occures while you need supress automatic AcceptChanges on DataAdapter via DataAdapter.AcceptChangesDuringUpdate = false

In case your DataRow is in Added state, it is always accepted by command itself.

Driver has to follow default functionality as written in MS article

http://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlcommand.updatedrowsource(VS.71).aspx

The default UpdateRowSource value is Both unless the command is automatically generated (as in the case of the SqlCommandBuilder), in which case the default is None.

That's because DataAdapter.AcceptChangesDuringUpdate is true by default, so changing NpgsqlCommand won't affect already exising code.

Nice day
Peposh

Followup

Message
Date: 2010-05-16 23:58
Sender: Peter Figuli

Oh forgot a file, sorry.
Date: 2010-05-16 23:47
Sender: Peter Figuli

Hi,
Excuse the delay of example, but I was a bit busy lately.
I'm not sure if few lines of code may explain the case, so I
prepared simple 'buy' example in VS 2010 express. I hope it
helps.

Peposh

PS: Example uses my build of driver.
Date: 2010-04-12 22:16
Sender: Francisco Figueiredo jr.


Nice to know you got it working.

Would you mind to send me a simple example of what you were trying to do so I can add it to our user manual so it can be used as sample code?

Thanks in advance.
Date: 2010-04-12 21:49
Sender: Peter Figuli

Hi,

My test works properly! Great job and thanks for prompt
response and fix.

Nice day
Peposh
Date: 2010-04-10 17:40
Sender: Francisco Figueiredo jr.


Hi, nice catch.

Fixed in cvs. Please, give it a try and let me know if it worked for you.

Thanks in advance.

Attached Files:

Attachments:
NpgsqlAcceptChangesDuringUpdateExample.zip

Changes:

Field Old Value Date By
File Added483: NpgsqlAcceptChangesDuringUpdateExample.zip2010-05-16 23:58peposh
Powered By FusionForge