Click here to Skip to main content
15,887,746 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
i have made a insert query used as registration and select query as login and checking but the problem is. it doesnt check for upper case how can i put that in my small scale app.
Posted
Updated 16-Dec-12 18:01pm
v2

You need to tell SQL to use a collation that is case sensitive.

Do this in your SQL:
SQL
WHERE password = @password COLLATE SQL_Latin1_General_CP1_CS_AS and Username=@Username


That tells SQL to treat "password = @password" with case sensitivity.
 
Share this answer
 
Comments
sariqkhan 14-Nov-12 16:58pm    
nice one
+5
but how do you do that? whats the concept behind that?
what is this COLLATE SQL_Latin1_General_CP1_CS_AS? i never heard before
ZurdoDev 14-Nov-12 17:01pm    
Collation defines how dates are stored, how strings are sorted (for example does 9AA come before or after AA) etc. It's kind of like a culture setting. If you look at the properties for your SQL database you'll see what the collation is set to. So, in this case, we're just overriding the collation to make it case sensitive. I actually worked on a DB once that had a case sensitive collation on the whole db. It was terrible. You had to have the case for field names correct or it could not find them.
shaikh-adil 14-Nov-12 17:00pm    
+5
sariqkhan 14-Nov-12 19:14pm    
nice explanation bro
thanx for helping
RaisKazi 14-Nov-12 19:47pm    
My 5+
For SQL you can use COLLATE.[^].

Here is an example link[^] for you.

Good luck,
OI
 
Share this answer
 
Comments
shaikh-adil 14-Nov-12 17:00pm    
+5
RaisKazi 14-Nov-12 19:47pm    
My 5!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900