Asp onrowupdating inserts new row

Hi All, I have create a web page which has two drop down list control bound to a table, as per the user selection, data is searched & displayed on second webpage using detailsview control. You can write update query to the main table and insert query to the history table by keeping the same PK. Dont keep primary key constraint in history table Do let me know if you want any more clarifications on this.

Now, I want to provide a functionality where, user can update/edit that record but while saving the update/changes it should be saved as new record, this will provide a complete history of changes done to that record as primary field will remain locked ex. Hence, You can check with validation control to validate the data before inserting the data. May be this code will help you, Gridview shows basically contact persons in a company. you will two sql calls because one to update or save new record in the history table.

This can be beneficial to other community members reading the thread.

When all you've got is a Hammer, Every Problem looks like a Nail. First, please confirm that your Data Base's column is case sensitive.

asp onrowupdating inserts new row-37asp onrowupdating inserts new row-22asp onrowupdating inserts new row-57asp onrowupdating inserts new row-52

Using a template field, I've created a drop down box to allow the user to input the status of the data for that particular time period. The logic flow would go something like this Alter Procedure.(Essentially, I'm asking "Show me all records for which there are no historical records within a specified range"...) I'm using that result set to feed my Grid View.Basically, I'm displaying all I need to know about the insert records - sans one piece of info.However, Update won't pass any fields that are marked Read Only.I think you can use the Conflict Detection property of Sql Data Source to influence this. Please remember to click “Mark as Answer” on the post that helps you.

Leave a Reply