Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#
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 14-Nov-12 10:38am
sariqkhan1.4K
Edited 16-Dec-12 18:01pm
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

You need to tell SQL to use a collation that is case sensitive.
 
Do this in your SQL:
 
WHERE password = @password COLLATE SQL_Latin1_General_CP1_CS_AS and Username=@Username
 
That tells SQL to treat "password = @password" with case sensitivity.
  Permalink  
Comments
sariqkhan at 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
ryanb31 at 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 at 14-Nov-12 17:00pm
   
+5
sariqkhan at 14-Nov-12 19:14pm
   
nice explanation bro
thanx for helping
RaisKazi at 14-Nov-12 19:47pm
   
My 5+
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

For SQL you can use COLLATE.[^].
 
Here is an example link[^] for you.
 
Good luck,
OI
  Permalink  
Comments
shaikh-adil at 14-Nov-12 17:00pm
   
+5
RaisKazi at 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)



Advertise | Privacy | Mobile
Web01 | 2.8.141022.2 | Last Updated 17 Dec 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100