Alright.
I am working in a web based.. In a LAN it will be..
It will read each row one by one.. There will be many data.. In table1 n table2. Once it find the matching field and check the amount that amout of table1 is not exceeding amount of table 2 then it will update those rows only which has not exceeded the amount.
And it wi update in a another table 3 that column name as verified. That amount is correctly updated to those employee.
Ok, that will be slow. Horribly slow.
Each row fetch involves a lan conversation, processing on the SQL side, data back to C#, processing there, and another conversation back to the SQL server again. If you are doing many rows, that's pretty damn slow.
Do it in SQL.
Set up a transaction, and do two update commands inside it.
Assuming you have three tables:
Table1
id, amt, updates
Table2
id, t1Id, amt
Table3
id, t1Id, verified
Then the two updates are pretty trivial:
UPDATE t1
SET t1.updates = t1.updates + 1
FROM Table1 t1
JOIN Table2 t2 ON t1.id = t2.t1Id
JOIN Table3 t3 ON t1.id = t3.t1Id
WHERE t1.amt < t2.amt
And
UPDATE t3
SET t3.verified = 'Yes'
FROM Table1 t1
JOIN Table2 t2 ON t1.id = t2.t1Id
JOIN Table3 t3 ON t1.id = t3.t1Id
WHERE t1.amt < t2.amt
Will let SQL work out the most efficient way to do that - and it's pretty good at it!
I'd set up an SP, containing those two inside a transaction (so if it fails there is nothing changed) and just execute that from the C#.
Nothing leaves SQL, and the processing is done by the software that's best at it.