Click here to Skip to main content
16,016,623 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
if i hv table contents like
C#
sony  lcd 24"
sony  lcd 24-a"
sony  lcd 24-b"
sony  lcd 24-c"
sony  lcd 24-d"
sony  lcd 24-e"
sony  lcd 32"
sony  lcd 32-a"
sony  lcd 32-b"
sony  lcd 34"

and i write in textbox like at runtime sony 24 thn it search all data regarding sony 24 using auto complete extender......so what is query to be
Posted
Updated 7-Nov-13 18:51pm
v2

1 solution

I wrote a small sample. Hope this helps

SQL
declare @t table
(
s varchar(50)
)


insert into @t values('sony lcd 24"')
 insert into @t values('sony lcd 24-a"')
 insert into @t values('sony lcd 24-b"')
 insert into @t values('sony lcd 24-c"')
 insert into @t values('sony lcd 24-d"')
 insert into @t values('sony lcd 25-e"')

 select * from @t where s like '%sony%24%'
 
Share this answer
 
Comments
Member 10385972 8-Nov-13 1:29am    
got it bt thr is one prob here if i will do it by auto complete extender and thn what'ill i write in query
ArunRajendra 8-Nov-13 1:33am    
I am not aware of auto complete. If you put the code I can try?
ArunRajendra 8-Nov-13 1:40am    
Ok I just had a quick glance auto complete extender. I looked at this sample http://www.aspdotnet-suresh.com/2011/05/ajax-autocompleteextender-sample.html. What you need to do is in your service method place prefixText = ("%" + prefixText.replace(" ","%") + "%"). Hope this helps you.
Member 10385972 8-Nov-13 3:50am    
here what is the defination of replace method
ArunRajendra 10-Nov-13 22:09pm    
Replace is a inbuilt string function (string.Replace()). See this link for more details. http://msdn.microsoft.com/en-us/library/fk49wtc1(v=vs.110).aspx

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900