following C# statement may help
sting Query = "update top (" + txtbox1.Text + ") TableName set Password = '" + txtPassword.Text + "' "
so lets say you have entered 5 in txtbox1 and "abc" in the txtPassword then
Query would be
update top (5) TableName set Password = 'abc'