This question is locked. New answers and comments are not allowed.
Hello !
I have this code
I have this code
IList <TwoFieldsClass> tempList1 = (from c in _localContext.CustomerMasters where c.CUSTNMBR.Contains(searchCriteria) select new TwoFieldsClass { Field1 = c.CUSTNMBR, Field2 = c.CUSTNAME }).OrderBy(f => f.Field1).ToList();
for searchcriteria = "p"
it generate the sql
declare @p1 intset @p1=1 exec sp_prepexec @p1 output,N'@p0 nchar(65)',N'SELECT a.[CUSTNMBR] AS COL1, a.[CUSTNAME] AS COL2 FROM [RM00101] a WHERE a.[CUSTNAME] LIKE ''%'' + @p0 + ''%'' ESCAPE ''\'' ',@p0=N'p' select @p1
but I have no results. templist1 has zero records
if I query direct in sql server
select custnmbr,custname from rm000101 where custname like '%p%'
i have a bunch of records
So my question is why the linq doesn't return anything ?
Regards,
Hans