sql语句中的错误where子句在password附近

时间:2012-06-12 05:52:51

标签: sql-server

我在sql语句中遇到错误。

  

(“server = RAJ-PC \ SQLEXPRESS; user id = sa; password = as64ws;   database = onlineshopping“,”select * from customer where userid ='“+   TextBox1.Text +“',password ='”+ TextBox2.Text +“'”);

我已编写此语句以连接到SQL Server。密码附近的SQL语句中显示错误。我的错误是什么???

1 个答案:

答案 0 :(得分:6)

使用AND组合多个where子句,而不是,

("server= RAJ-PC\SQLEXPRESS; user id=sa; password=as64ws; database=onlineshopping", "select * from customer where userid='" + TextBox1.Text + "' AND password='" + TextBox2.Text + "'");