关于登陆语句的!ASP.NET2.0+SQL Server2005
stringconn="server=.;database=shiyan;uid=sa;pwd=123456";SqlConnectioncn=newSqlConnect...
string conn = "server=.;database=shiyan;uid=sa;pwd=123456";
SqlConnection cn = new SqlConnection(conn);
cn.Open();
string strsql = "select * from [user] where username='" +Username .Text + "' and userpad'" + password.Text + "'";
SqlCommand cmd = new SqlCommand(strsql, cn);
SqlDataReader dr = cmd.ExecuteReader();//总说123456附近有语法错误!也不知道哪错了!
我很急要,谢谢!大家! 展开
SqlConnection cn = new SqlConnection(conn);
cn.Open();
string strsql = "select * from [user] where username='" +Username .Text + "' and userpad'" + password.Text + "'";
SqlCommand cmd = new SqlCommand(strsql, cn);
SqlDataReader dr = cmd.ExecuteReader();//总说123456附近有语法错误!也不知道哪错了!
我很急要,谢谢!大家! 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询