[讨论]麻烦看一下这是什么错误?连接数据库
部分代码:String userName=Request.Form["userName"].ToString();
String userpwd=Request.Form["userpwd"].ToString();
SqlConnection conn=new SqlConnection("server=.;database=login;uid=sa;pwd=;");
conn.Open();
SqlCommand cmd=new SqlCommand(selectCount(*) from login where userName='"+userName+"' and userpwd='"+userpwd+"'",conn);出错
int count=convert.toInt32(cmd.ExecuteScalar());
if(count>0)
{
Response.Redirect("main.axpx");
}
else
{
Response.Redirect("loginFail.axpx");
}
出错提示为:字符文本中字符太多
常数中有有换行符
应输入;