ADO.NET中总是提示输入字符串的格式不正确(求大神帮忙改正错误)
private void button3_Click(object sender, EventArgs e){
student.glpwd = watermarkTextBoxGLPWD.Text;//管理员密码
SqlCommand cmd = new SqlCommand();
try
{
student.con.Open();
cmd.Connection = student.con;
= "select * from adminpwd where 密码='" + student.glpwd + "'";
int n = Convert.ToInt32(cmd.ExecuteScalar());
student.con.Close();
if (n <= 0)
{
MessageBox.Show("密码输入错误!");
}
else
{
admin1 f4 = new admin1();//第四个窗体(管理员)
this.Hide();
f4.ShowDialog();
}
[此贴子已经被作者于2018-6-7 10:58编辑过]