tags:

views:

102

answers:

1

I want to ensure that the websites users don't mess up the primary data table so before each update the non-updated data should be stored into a history table.

I am thinking of using the 'RowUpdating' event on the GridView to do this.

How do I manually run a insert query using my existing SQLDataSource?

Overall flow would work like this:

  1. gridview shows field1 field2 test 1234
  2. user edits gridview values field1 field2 test 3333 3a. user selects 'update' button 3b. system records that data was test,1234
A: 

You could set up a trigger on the primary data table which chronicles the updates to the separate history table. As long as this UI isn't going to be terribly busy and hitting the table like crazy, a trigger might be suitable.

Darth Continent
Would the trigger pull the selected primary key value?
John M
The trigger uses an ad hoc table (not sure if that's the proper term) which contains a record being inserted, updated or deleted. For example in an INSERT operation on a given table, you would use "SELECT myPrimaryKey FROM Inserted", for a delete it would be "SELECT myPrimaryKey FROM Deleted". You can set a variable to the key value, cursor with it, other operations.
Darth Continent