P
Patrik Ellrén
The DataAdapter.Update method returns an int to indicate how many rows were
successfully updated but if I set the UpdateCommand to a stored procedure
how do I hook it up to return the correct value and so that ADO.NET can
recognize when it fails and call RejectChanges on the rows that couldn't be
updated?
For example, if I have this simple procedure (sorry for any SQL errors)
PROCEDURE UpdateRow(
anId IN NUMBER,
aValue IN VARCHAR2,
prevLastModified IN TIMESTAMP) IS
BEGIN
UPDATE MyTable SET
value = aValue,
lastModified = SYSTIMESTAMP
WHERE
id = anId AND
lastModified = prevLastModfied;
END;
How does ADO.NET know when the timestamp check fails? Do I have to return
anything special or is this logic implemented in the database specific
connection classes? I connect to an Oracle 9i database if that matters.
Thanks.
successfully updated but if I set the UpdateCommand to a stored procedure
how do I hook it up to return the correct value and so that ADO.NET can
recognize when it fails and call RejectChanges on the rows that couldn't be
updated?
For example, if I have this simple procedure (sorry for any SQL errors)
PROCEDURE UpdateRow(
anId IN NUMBER,
aValue IN VARCHAR2,
prevLastModified IN TIMESTAMP) IS
BEGIN
UPDATE MyTable SET
value = aValue,
lastModified = SYSTIMESTAMP
WHERE
id = anId AND
lastModified = prevLastModfied;
END;
How does ADO.NET know when the timestamp check fails? Do I have to return
anything special or is this logic implemented in the database specific
connection classes? I connect to an Oracle 9i database if that matters.
Thanks.