Click here to Skip to main content
16,004,782 members

Comments by RajeshKumar Sugumar (Top 6 by date)

RajeshKumar Sugumar 23-Aug-13 6:21am View    
Thanks !!!

But this is not my excepted Solution. I need to use the SQL Query as like in Linq .

Anyway thanks .......
RajeshKumar Sugumar 22-Aug-13 10:26am View    
*2 means ProcessID ends with 2, 2* means ProcessID starts with 2, *2* means ProcessID Contains 2. If i used Contains for all these means the excepted output will me failed.

If the User Except the ProcessID starts with 2 means , the Outcome result will be "Contains" ProcessID.

Sample Data
PROCESSID
21
11
12
222
245
357
572

if the User Search for 2* means , the outcome result will be "21,222,245". If i used "contains" means the outcome result will be "21,12,222,245,572". So this is Wrong Output.
RajeshKumar Sugumar 22-Aug-13 5:32am View    
ok. But i use this query for my search page so the user can search the values in any way (2*,*2,*2*) . Here i want to do all this operation in same Where condition itself . This is the problem which i am facing here.
RajeshKumar Sugumar 22-Aug-13 5:14am View    
its "2%" only
RajeshKumar Sugumar 22-Aug-13 5:04am View    
This is Query i am using in SqlServer.

Select * from PROCESS Where CAST(ProcessID as varchar) Like '2*'

The Linq Query which i tried is

var people = (from t in sample.PROCESSes
where SqlMethods.Like(SqlFunctions.StringConvert((double)t.ProcessID), (check.Replace("*", "%"))) == true
select t).ToList();

AND

var query1 = from c in sample.PROCESSes
where SqlFunctions.CharIndex(SqlFunctions.StringConvert((double)c.ProcessID), check) > 0
select c;
these are ways but i not getting the output ......