Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2004
    Posts
    21

    Unanswered: A problem with a normalSELECT statement

    I'm using a simple SELECT statement, that already works for another solution, but for some reason I get this statement -

    ========================================
    Incorrect syntax near the keyword 'user'
    =========================================

    This is the sql statment -
    ----------------------------------------------------------------------
    string sSQL = "SELECT userId FROM user WHERE username=@username AND userPasword=@Password";

    SqlCommand cCommand = new SqlCommand();
    cCommand.CommandText = sSQL;

    cCommand.Parameters.Add("@username", SqlDbType.VarChar).Value= pUsername;
    cCommand.Parameters.Add("@userPassword", sqlDbType.VarChar).Value = pPassword;
    ------------------------------------------------------------------------

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    mysql has its own user table, try renaming your user table
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Mar 2004
    Posts
    21

    Prob was with the table name

    Originally posted by r937
    mysql has its own user table, try renaming your user table

    That was the problem. The other table was called users. Thanks for the tip

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •