我在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语句中显示错误。我的错误是什么???
答案 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 + "'");