.Tolower() is not working in linq query

list = (from sr in dbContext.SERVICE_REQUEST
             join sc in dbContext.SERVICE_CUSTOMER on sr.CUSTOMER_ID equals sc.CUSTOMER_ID)
              where  (sr.SERVICE_REQUEST_NO.ToLower().Contains(objtobeAdvSearch.ServiceRequestNumber.ToLower()))

from above is sample query. my task is serach value,for that iam comparing oracle database filed and search value(objtobeAdvSearch). now i am converting tolower for comparision. but not working can u plz help me regarding this
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Ryan ChongCommented:
few things to check..

1. what's the variable type of sr.SERVICE_REQUEST_NO ? Object, String, etc?
2. what's the variable type of objtobeAdvSearch.ServiceRequestNumber ? Object, String, etc?
ganeahdevAuthor Commented:
Ryan ChongCommented:
when you mentioned "not working", is that no result was selected or generated an error?

if it's no result, can you putting break point and then debug to compare what's the values for:


Easwaran ParamasivamCommented:
list = (from sr in dbContext.SERVICE_REQUEST
             join sc in dbContext.SERVICE_CUSTOMER on sr.CUSTOMER_ID equals sc.CUSTOMER_ID)
where  (sr.SERVICE_REQUEST_NO.IndexOf(objtobeAdvSearch.ServiceRequestNumber, StringComparison.OrdinalIgnoreCase) != -1))

Use IndexOf along with StringComparison.OrdinalIgnoreCase option. It should work.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Prakash SamariyaIT ProfessionalCommented:
where  (sr.SERVICE_REQUEST_NO.Equals(objtobeAdvSearch.ServiceRequestNumber,StringComparison.OrdinalIgnoreCase))
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.