VB syntax RRS feed

  • Question

  • User-863835478 posted
    How could this T-SQL part "where cdata in ('a','b','c')" be most simply rendered in VB.NET? Thanks.
    Tuesday, April 8, 2008 1:15 PM


  • User1191518856 posted

    I'm afraid there's no slick way to do this in code.

    If cdata = "a" Or cdata = "b" Or cdata = "c" Then ...

    You could probably create an array on the fly and use it, but I doubt this is better performance-wise:

    If Array.IndexOf(New String() { "a", "b", "c" }, cdata) > 0 Then ... 
    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, April 8, 2008 3:22 PM