DB2 Select Syntax Error

  • Thread starter Thread starter Antoni Massó Mola
  • Start date Start date
A

Antoni Massó Mola

Hi,

I have two values I receive from a form:

strLogin = Request.Form["txtLogin"]; strPassword =
Request.Form["pwdPassword"];

I then need to include it in a Select query to validate the username and
password, but the syntax is not correct.

Any ideas?

OleDbDataReader myReader = adoConn.dbSQLSelect("Select USERNAME, PASSWORD
from USERS where USERNAME = "'" + strLogin.Text + "'" & PASSWORD = "'" +
strPassword.Text + "'"");
 
OleDbDataReader myReader = adoConn.dbSQLSelect("Select USERNAME, PASSWORD
from USERS where USERNAME = "'" + strLogin + "'" & PASSWORD = "'" +
strPassword + "'"");
Antoni Massó Mola said:
Hi,

I have two values I receive from a form:

strLogin = Request.Form["txtLogin"]; strPassword =
Request.Form["pwdPassword"];

I then need to include it in a Select query to validate the username and
password, but the syntax is not correct.

Any ideas?

OleDbDataReader myReader = adoConn.dbSQLSelect("Select USERNAME, PASSWORD
from USERS where USERNAME = "'" + strLogin.Text + "'" & PASSWORD = "'" +
strPassword.Text + "'"");
 
Back
Top