I have tried this line of code but it ran into an error
CMR cmr = _cmrServices.GetAllWithAll().Where(x => x.CMRSerial == cmrSearchDeliverySerialNumber).FirstOrDefault();
Inner Exception 1:
SqlException: Execution Timeout Expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
Inner Exception 2:
Win32Exception: The wait operation timed out
I couldn't change the type of my fields to integer in the database also neither can compare my value to the string of a number because it gets a timeout error.
but as you can see they are numeric with string type.
this field cmrSearchDeliverySerialNumber
is string though ,no matter what type it is I can't filter CMRSerial
field as an integer.
I dont know should I use SqlFunctions.StringConvert or somthing else to convert CMRSerial` to an integer.
unfortunately I cant set index on CMRSerial
field due its type is nvarchar(max)
and I can't compare it as string to another string.
I ran this line of codes after executin my query that was created by profiler
SELECT QP.query_plan as [Query Plan],
ST.text AS [Query Text]
FROM sys.dm_exec_requests AS R
CROSS APPLY sys.dm_exec_query_plan(R.plan_handle) AS QP
CROSS APPLY sys.dm_exec_sql_text(R.plan_handle) ST;