I want to know the if condition to check whether the row in a table has been updated or not.
After checking i have to insert the changes into a new table.
please help
Thanks in advance.
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Jiteendra SampathiraoPosted Jul 25, 2011, 6:22 AM
use the status column to find edited or not...
When you insert a record into your database table make status as 1 and when you are updating the record make status as 2.
then you can easily find out howmany records are edited....
update table_name set name= 'your_name', status=2 where id= your_id;
then
select id, name from table_name where status=2;
i hope it help you.......
Zoran HorvatPosted Jul 25, 2011, 6:05 AM
Detached,
Unchanged,
Added,
Modified,
Deleted
When you're using DataTable to contain multiple DataRow objects, then you can use its GetChanges() method to get all modified/added/deleted rows. You can use its AcceptChanges() and RejectChanges() methods to automatically update the row and synchronize it with database.
Zoran