代码不工作 - 更新表

问题描述:





我正在尝试更新表但代码无效!我试着理解为什么但是找不到!



Hi,

i am trying to update the table but the code is not working! I tried to understand why but can't find out!

if (theval == "zero")  // if i take the if statement it will work! but if i have response.write(theval); i get zero!
{
    SqlConnection con2 = new SqlConnection("Data Source=MZC-RWAHDAN\\MYPROJECT2015;Persist Security Info=True;User ID=sa; Password=xxxx;Initial Catalog=Testing_database");
                                
    SqlCommand command2 = new SqlCommand("UPDATE users_login SET TheAttempts = 'one' WHERE UserName = @UserName", con2);

    con2.Open();
    command2.Parameters.Add(new SqlParameter("@UserName", TextBox1.Text));
    command2.ExecuteNonQuery();
    warningmsg.Text = "wrong password!!, You have 2 attempts left";
}





请帮助,

谢谢。



please help,
Thanks.

OMG !!!!!



0和0保留...我错过了!
OMG!!!!!

zero and 0 are reserved... I missed that!