帮助登录命令,它不起作用 [英] Help with the login command, it is not working
本文介绍了帮助登录命令,它不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在条件中显示错误的命令(if)
The command its showing an error in the Condition (if)
SqlConnection SqlCon = new SqlConnection(ConfigurationManager.ConnectionStrings["WSPCCon"].ConnectionString);
SqlCommand SqlCmd = new SqlCommand("SELECT * FROM TablaAdministradores WHERE Nombre = '" + txt_Usuario + "' and PWDCOMPARE('" + txt_Contrasena + "', Contrasena)= '1'", SqlCon);
DataTable dt = new DataTable();
SqlDataAdapter da = new SqlDataAdapter(SqlCmd);
da.Fill(dt);
if (dt.Rows[0][0].ToString()=="1")
{
MessageBox.Show("Error al ingresar los datos, favor revisar");
txt_Contrasena.Clear();
txt_Usuario.Clear();
txt_Usuario.Focus();
}
else
{
loadInfo();
VentEsc.Show();
this.Hide();
}
SqlCon.Close();
帮助
Help
推荐答案
究竟是什么错误?
What is the error exactly?
这篇关于帮助登录命令,它不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文