Sant Roy

Sant Roy

  • NA
  • 85
  • 5.1k

asp.net listview searching with SQL query

Dec 18 2015 4:06 AM
i have a listview with search options with three fileds name,comment,description.i have implement the search options using this query.
 
 
SELECT OrganizationID,
Name,
DescriptionShort,
DescriptionLong, Comment,
DateUpdated,
FROM t_Organization
where t_Organization.Name like '%'+@name+'%'
or t_Organization.DescriptionShort like '%'+@name+'%'
or t_Organization.DescriptionLong like '%'+@name+'%'
or t_Organization.Comment like '%'+@name+'%'
ORDER BY Name
 
 
it works perfectly.but if when i add a extra string then no records are fetching.
 
like 'player' search perfectly
like 'play'  search perfectly
like 'pla' search perfectly 
like 'pl' search perfectly  
like 'p' search perfectly  
 
but 'Players' , not work
like 'playerw' not work
like 
like 'playing' not work.
means when we add a extra string it does not work .
.how can i do this?
i need all.
search will happen because play is common..
please  help me....how can i do this? 
 
 
 

Answers (3)