Search list Box values using C#.net

Posted by Naraayanan under C# on 6/29/2012 | Points: 10 | Views : 2504 | Status : [Member] | Replies : 7
Hi,
How to search list values in C#.net. In my application , It has a Textbox, button and ListBox. user enter in the Textbox and It will show in the List box when user clicks Button. but i don't want to repeated value in the list box.

Regards,
Lakshmi Naraayanan.S
http://dotnettechrocks.blogspot.in/
http://abaprocker.blogspot.com/



Responses

Posted by: Premalatha on: 6/29/2012 [Member] Starter | Points: 25

Up
0
Down
This may use for u;

http://www.codeproject.com/Articles/30485/Using-Find-in-a-Generic-List

Premalatha
Software Engineer

Naraayanan, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Superb1986 on: 7/1/2012 [Member] Starter | Points: 25

Up
0
Down
HI,
You can use the linq query with the distinct. because you are going to show only the description in the listbox so you can apply the distinct with the description. for eg
var mycoll = (from item in objList
where item.Desc == textbox.text
select new { Description = item.Desc}).Distinct().ToList();

So you can use this powerfull linq, i hope you may get an idea.

Naraayanan, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Premalatha on: 7/2/2012 [Member] Starter | Points: 25

Up
0
Down
Ok,

Thank you

Premalatha
Software Engineer

Naraayanan, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Calvert on: 7/2/2012 [Member] Starter | Points: 25

Up
0
Down
You should Use Date time method.Date Time is immutable, and any method to modify it returns a new DateTime, it does not alter the one you are using.you can parse it to string, and change the string to your own "datetime" format but remember, this is not going to be a real DateTime value any longer.
http://www.dapfor.com/en/net-suite/net-grid/tutorial


Naraayanan, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Premalatha on: 7/3/2012 [Member] Starter | Points: 25

Up
0
Down
Ok thank you,

Premalatha
Software Engineer

Naraayanan, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: perfectchourasia-9163 on: 7/4/2012 [Member] Starter | Points: 25

Up
0
Down
thanks for information

ER sandeep chourasia
sandeepchrs@yahoo.com (on facebook)
http://www.aspnetcodes.com/

Naraayanan, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Premalatha on: 7/4/2012 [Member] Starter | Points: 25

Up
0
Down
Your Welcome

Premalatha
Software Engineer

Naraayanan, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response