option compare binary or text?
What do most of you use and is there a particular reason for it, other than one being the default? For a multi-lingual application, which would be the better choice ?
I need my data to be case-sensitive, i.e. if my user changes "amy" to "Amy" my system needs to recognise that and record it as a change.
I don't think I'll ever need to sort data in my application and UI layer, because I get all my data from my sql server database and the sorting is done there.
But with the default option compare binary, I'll need to remember to use .toUpper or toLower to ensure case-insensitive comparisons when I check status fields, like if x.statusCode.tolower = "active" then...
Would like to hear some suggestions. Thanks.
I dont rely on the option compare for string comparisons. I prefer to be explicit when i perform the compare.
For case insensitive comparisons
If String.Compare(stringa, stringb, True)=0 Then 'strings are equal
for case sensitive
If String.Compare(stringa, stringb, False)=0 Then 'strings are equal
http://msdn2.microsoft.com/en-us/library/zkcaxw5y(VS.80).aspx
0 comments:
Post a Comment