Search:
Namespaces
Discussions
.NET v1.1
Feedback
Bug in DataAdapter Update?
Messages
Related Types
This message was discovered on
ASPFriends.com 'aspngescalate' list
.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.
Jesse Liberty (VIP)
I posted this (twice) to aspngData and received no answers at all. This is
pretty urgent for me as I'm writing about this feature on deadline...
Is this a bug or am I missing something?
I follow these steps:
1) populate a dataset from two tables in the db (into one table in the
dataset)
2) modify one or more records in the dataset
3) hand-modify the record in the db (simulating a concurrency problem)
4) update the db from the dataset by calling dataAdapter.Update()
I've set an update command object which calls a sproc
That sproc takes many params including all the new values
and all the original values (from
param.sourceVersionda;taRowVersion.original)
Thus the sproc is something like
update table1 set field1 n;ewValue, field2 n;ewValue where field1 oldValue and field2 o;ldValue
This causes a concurrency failure and the where clause in the sql statement
fails (as it should)
The database is NOT updated (and it should not be - the where statement
fails)
But here's the problem: the dataAdapter.Update returns 1 row updated (when
it should return 0) and no concurrency excpetion is thrown.
If I do not alter the record concurrently, then the update does happen
(good) and still dataAdapter.Update still returns 1 row updated.
The bug is that I think it should return 0 rows updated (and throw a
concurrency exception) when it can not update. Am I missing something?
I'm at a loss.
Thanks.
-j
-------------------------------
Jesse Liberty
Reply to this message...
Mitch Denny (VIP)
Jesse,
Might be a wild stab in the dark here, but it might be
something to do with the fact that you are running a sproc,
and from the DataAdapter's point of view everything is
working nicely.
Have you got some code?
----------------------------------------
- Mitch Denny
-
http://www.warbyte.com
-
Click here to reveal e-mail address
- +61 (414) 610-141
-
-----Original Message-----
From: Jesse Liberty [mailto:
Click here to reveal e-mail address
]
Sent: Thursday, 6 September 2001 10:55 PM
To: aspngescalate
Subject: [aspngescalate] Bug in
DataAdapter
Update?
I posted this (twice) to aspngData and received no answers at all. This
is pretty urgent for me as I'm writing about this feature on deadline...
Is this a bug or am I missing something?
I follow these steps:
1) populate a dataset from two tables in the db (into one table in the
dataset)
2) modify one or more records in the dataset
3) hand-modify the record in the db (simulating a concurrency problem)
4) update the db from the dataset by calling dataAdapter.Update()
I've set an update command object which calls a sproc
That sproc takes many params including all the new values
and all the original values (from
param.sourceVersion=dataRowVersion.original)
Thus the sproc is something like
update table1 set field1 = newValue, field2 = newValue where field1
= oldValue and field2 = oldValue
This causes a concurrency failure and the where clause in the sql
statement fails (as it should)
The database is NOT updated (and it should not be - the where statement
fails)
But here's the problem: the dataAdapter.Update returns 1 row updated
(when it should return 0) and no concurrency excpetion is thrown.
If I do not alter the record concurrently, then the update does happen
(good) and still dataAdapter.Update still returns 1 row updated.
The bug is that I think it should return 0 rows updated (and throw a
concurrency exception) when it can not update. Am I missing something?
I'm at a loss.
Thanks.
-j
-------------------------------
Jesse Liberty
| [aspngescalate] member
Click here to reveal e-mail address
= YOUR ID |
http://www.asplists.com/asplists/aspngescalate.asp
= JOIN/QUIT
Reply to this message...
Dan Green (VIP)
On behalf of Jesse...
----- Original Message -----
From: Jesse Liberty
To: aspngdata
Sent: Thursday, September 06, 2001 11:37 PM
Subject: [aspngdata] RE: Bug in dtaAdapter.Update()
I figured this out. The problem was that the sproc was updating more than
one table, and thus the final value for @@rowcount returned was greater than
0, confusing the data adapter.
Thanks.
-j
----- Original Message -----
From: "Mitch Denny" <
Click here to reveal e-mail address
>
To: "aspngescalate" <
Click here to reveal e-mail address
>
Sent: Sunday, September 09, 2001 2:11 AM
Subject: [aspngescalate] RE: Bug in
DataAdapter
Update?
[Original message clipped]
Reply to this message...
System.Data.Common.DataAdapter
Ad
MBR BootFX
Best-of-breed application framework for .NET projects, developed by Matthew Baxter-Reynolds and MBR IT
Copyright © Matthew Baxter-Reynolds 2001-2008. '.NET 247 Software Development Services' is a trading style of MBR IT Solutions Ltd.
Contact Us
-
Terms of Use
-
Privacy Policy
-
www.dotnet247.com