Click here to Skip to main content
15,882,721 members
Home / Discussions / Visual Basic
   

Visual Basic

 
Questionvb6 - invalid property array index Pin
jhovyn12-Feb-17 20:59
jhovyn12-Feb-17 20:59 
AnswerRe: vb6 - invalid property array index Pin
Mycroft Holmes12-Feb-17 21:29
professionalMycroft Holmes12-Feb-17 21:29 
AnswerRe: vb6 - invalid property array index Pin
Ralf Meier12-Feb-17 21:54
mveRalf Meier12-Feb-17 21:54 
GeneralRe: vb6 - invalid property array index Pin
Richard Deeming13-Feb-17 1:17
mveRichard Deeming13-Feb-17 1:17 
AnswerRe: vb6 - invalid property array index Pin
Richard Deeming13-Feb-17 1:22
mveRichard Deeming13-Feb-17 1:22 
Questionvb.net, Linq, use or where and or and contains Pin
jkirkerx10-Feb-17 11:25
professionaljkirkerx10-Feb-17 11:25 
AnswerRe: vb.net, Linq, use or where and or and contains [solved] Pin
jkirkerx10-Feb-17 11:35
professionaljkirkerx10-Feb-17 11:35 
GeneralRe: vb.net, Linq, use or where and or and contains [solved] Pin
Richard Deeming12-Feb-17 2:04
mveRichard Deeming12-Feb-17 2:04 
jkirkerx wrote:
Case Sensitive?

That depends on where you're executing the query, and is one of the more annoying quirks of LINQ.

If you're querying an in-memory list, string comparisons are case-sensitive by default. You can either "normalize" the strings using ToUpper / ToLower (you should prefer upper-case[^], due to the "Turkish I" problem[^]), or you could use IndexOf and pass a case-insensitive StringComparison. (Annoyingly, there isn't an overload of Contains which takes a StringComparison option.)

Passing a StringComparison option is preferable to changing the case, because it doesn't involve creating a new copy of the string.

If you're using a database, your query will use the collation[^] for the column you're querying. Most databases use a case-insensitive collation by default, so your query will be case-insensitive.

If you try to pass a StringComparison when you're querying a database, you'll get an exception telling you that the method can't be converted to a database query.

Not that this is a leaky abstraction or anything! Roll eyes | :rolleyes:



"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer


GeneralRe: vb.net, Linq, use or where and or and contains [solved] Pin
jkirkerx13-Feb-17 6:30
professionaljkirkerx13-Feb-17 6:30 
QuestionLine in Volume control! Pin
User 98970748-Feb-17 7:54
User 98970748-Feb-17 7:54 
AnswerRe: Line in Volume control! Pin
Michael_Davies8-Feb-17 9:10
Michael_Davies8-Feb-17 9:10 
GeneralRe: Line in Volume control! Pin
User 98970749-Feb-17 0:00
User 98970749-Feb-17 0:00 
GeneralRe: Line in Volume control! Pin
Michael_Davies9-Feb-17 3:46
Michael_Davies9-Feb-17 3:46 
GeneralRe: Line in Volume control! Pin
ZurdoDev10-Feb-17 5:28
professionalZurdoDev10-Feb-17 5:28 
AnswerRe: Line in Volume control! Pin
Ralf Meier8-Feb-17 9:51
mveRalf Meier8-Feb-17 9:51 
GeneralRe: Line in Volume control! Pin
User 98970748-Feb-17 23:58
User 98970748-Feb-17 23:58 
GeneralRe: Line in Volume control! Pin
Richard MacCutchan9-Feb-17 0:44
mveRichard MacCutchan9-Feb-17 0:44 
GeneralRe: Line in Volume control! Pin
User 98970749-Feb-17 1:15
User 98970749-Feb-17 1:15 
GeneralRe: Line in Volume control! Pin
Richard MacCutchan9-Feb-17 1:44
mveRichard MacCutchan9-Feb-17 1:44 
GeneralRe: Line in Volume control! Pin
User 98970749-Feb-17 1:52
User 98970749-Feb-17 1:52 
GeneralRe: Line in Volume control! Pin
Richard MacCutchan9-Feb-17 1:53
mveRichard MacCutchan9-Feb-17 1:53 
GeneralRe: Line in Volume control! Pin
User 98970749-Feb-17 2:29
User 98970749-Feb-17 2:29 
GeneralRe: Line in Volume control! Pin
Eddy Vluggen9-Feb-17 2:34
professionalEddy Vluggen9-Feb-17 2:34 
GeneralRe: Line in Volume control! Pin
User 98970749-Feb-17 2:48
User 98970749-Feb-17 2:48 
GeneralRe: Line in Volume control! Pin
Eddy Vluggen10-Feb-17 4:23
professionalEddy Vluggen10-Feb-17 4:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.