代码不工作 - 更新表 [英] code not working - updating table
本文介绍了代码不工作 - 更新表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试更新表但代码无效!我试着理解为什么但是找不到!
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!
这篇关于代码不工作 - 更新表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文