How can I get the updated object when the user presses one of my other action buttons? Currently if we need to retrieve the Old Values and New Values and key values from the paramters collection ,the best means is utilize the details View's buildin Updating command.And if you don't want to use the buildin edit/update/cancel button, of course we can use our own buttons, we can add a custom field and put our own submit or linkbutton in it. And a good "trick", too, is to add one more field to the history table: When Added To History DATETIME DEFAULT get Date() So now you automatically have a complete audit trail. Ok, that makes more sense - but I am still unclear on how to reference the old values inside this Item Updating event. Item Updating How do I get the key of the record that is about to be updated in this subroutine to pass to the stored procedure? Any ideas on how to make this work, or even a better way of saving the old records to a different table? GBianchi suggested using SELECT INTO, but of course that doesn't work because you can only use it when the "INTO" table does not yet exist. If you simply record the Primary Key of the record you are displaying, then part of the process of updating the main table would be to just do INSERT INTO my History Table SELECT * FROM my Main Table WHERE primary Key = @pk The only "trick" here is that the history table has to *NOT* declare any of its fields to be primary keys or foreign keys or IDENTITY, but otherwise they have the same types as the fields in the main table. Details View Update Event Ar gs) Handles Data Table. Message) End Try 'The error I am getting is: The Sql Parameter Collection only accepts non-null Sql Parameter type objects, not String objects. ): WORKS ON MY MACHINE ========= I know that CVS was evil, and now i got the proof: =========Why not do it all in SQL???I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest.
I want to do something simple like this: form View. (This posting is provided "AS IS", with no warranties, and confers no rights.) -------------------- | Thread-Topic: Details View and Object Data Source - how to get updated object | thread-index: Ac XI V3y M7Jnzt0DTLa RAv FSe Syfu Q== | X-WBNR-Posting-Host: 188.8.131.52 | From: "=? | | I can get the updated object if I set Update Method, let ASP.NET autogenerate | an update button, and then press update after making changes, but I don't | want that update button.A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.