Quantcast
Channel: ADO.NET, Entity Framework, LINQ to SQL, NHibernate
Viewing all articles
Browse latest Browse all 1698

LINQ : Contains not checking properly in the entire sentence of a column

$
0
0

Hi,

I am checking and returning boolean value. But, it is returning always false.

MyInParameter : "APPLE"

My table Column 

Col1
ORANGE/APPLE A_B/BANANA
APPLE A_C/ORANGE/GUAVA
ORANGE/BANANA
ORANGE/APPLE A_B/BANANA
APPLE A_C/ORANGE/GUAVA
ORANGE/BANANA

Actually there is a word "APPLE" will be there in Col1. It should suppose to return "TRUE".

But, it will return false. any problem in my LINQ query.

below my LINQ Query

 bool Result1 = DTRes.AsEnumerable().Any(row => MyInParameter == row.Field<String>("Col1")); 

what is the problem in my query..?


Viewing all articles
Browse latest Browse all 1698

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>