Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2007
    Posts
    42

    Unanswered: executeScalar - count(*)

    i have Cust table with 5 columns (Name, Add, Contact, UserID, Passwd)

    my sql statement is not working correctly..
    "SELECT COUNT(*) FROM Cust WHERE UserID='" + textBoxEmail + "'AND Passwd='" + textBoxPW + "'"

    what maybe the problem? i have 1 record and when im running it, whether the input is right or wrong, the count is always zero(0). i think the problem is in my sql statement(maybe in the where clause) because i tried counting the records by "select count(*) from cust" and it correctly says 1 record. pls help!

  2. #2
    Join Date
    Feb 2007
    Posts
    42
    ow... i forgot the .Text of the textboxes...
    it's now solved!

  3. #3
    Join Date
    May 2004
    Location
    Seattle
    Posts
    1,313
    please don't write code like this unless you want criminals to steal your data.

    see http://www.dbforums.com/showpost.php...08&postcount=7

  4. #4
    Join Date
    Feb 2007
    Posts
    42
    ow... tnx 4 ur concern! actually i don't know securities like that because im just doing a project in my subject and don't care about those things. but i really appreciate ur response and i will study those links. tnx again!

Posting Permissions

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