Wednesday, March 21, 2012

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!ow... i forgot the .Text of the textboxes...
it's now solved!|||please don't write code like this unless you want criminals to steal your data.

see http://www.dbforums.com/showpost.php?p=6263508&postcount=7|||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!

No comments:

Post a Comment