Link to home
Create AccountLog in
.NET Programming

.NET Programming

--

Questions

--

Followers

Top Experts

Avatar of ganeahdev
ganeahdev

.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

Zero AI Policy

We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.


Avatar of Ryan ChongRyan Chong

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?

Avatar of ganeahdevganeahdev

ASKER

STRING

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:

sr.SERVICE_REQUEST_NO.ToLower()
objtobeAdvSearch.ServiceRequestNumber.ToLower()

?

Reward 1Reward 2Reward 3Reward 4Reward 5Reward 6

EARN REWARDS FOR ASKING, ANSWERING, AND MORE.

Earn free swag for participating on the platform.


ASKER CERTIFIED SOLUTION
Avatar of Easwaran ParamasivamEaswaran Paramasivam

Link to home
membership
Log in or create a free account to see answer.
Signing up is free and takes 30 seconds. No credit card required.
Create Account

where  (sr.SERVICE_REQUEST_NO.Equals(objtobeAdvSearch.ServiceRequestNumber,StringComparison.OrdinalIgnoreCase))
.NET Programming

.NET Programming

--

Questions

--

Followers

Top Experts

The .NET Framework is not specific to any one programming language; rather, it includes a library of functions that allows developers to rapidly build applications. Several supported languages include C#, VB.NET, C++ or ASP.NET.