The variable name \'@LockState\' has already been declared. Variable names must be unique within a query batch or stored procedure.
Wh
I put rwd.Parameters.Clear(); into loop and it solved the problem.
rwd.Parameters.Clear();