Saturday, 22 March 2014

linq query like operator

Like operator is not working properly in LINQ instead of it we can use the method Contains.

Using the Like Operator in Linq Query to get the result set, We use Contains.

     string Name = "test";
        var prsn = from o in objValue
                      orderby   o.WorkingDate descending 
                      where o.Name.Contains(Name) //no data is rendered when you have two or more text query unlike one text alone.
                      select o ;

No comments:

Post a Comment