string sql = "select count(0) from admin where IsLocked=@IsLocked";
"@IsLocked"= "0" 时执行结果88 这是正确的
"@IsLocked"= "0 or 1=1" 时执行结果0
这样是可以防sql注入
string sql = "exec('select count(0) from admin where IsLocked='+@IsLocked)";
"@IsLocked"= "0" 时执行结果88
"@IsLocked"= "0 or 1=1" 时执行结果192
为什么???