none
Wildcard in LINQ

    Question

  • Hi.

    In the Linq below, what should be inside "Contain", so that it is equivalent to '%2[0-9][0-9]-%' in SQL?

    these are the matching ids:

    AB200-32

    FE210-15

    RE223-152

    Linq:
    var qy = (from p in vw1
        where (p.custid = "1234" && p.id.Contains(???))
        select p).Take(1);
    
    
    SQL: where id like '%2[0-9][0-9]-%'
    
    Please advice and thanks in advance.


    • Edited by wkpli Friday, January 27, 2017 8:33 PM
    Friday, January 27, 2017 8:25 PM