Click here to Skip to main content
15,902,871 members
Home / Discussions / C#
   

C#

 
AnswerRe: How to use Combo.SetEditSel in C# Pin
Richard MacCutchan2-Jul-10 0:23
mveRichard MacCutchan2-Jul-10 0:23 
QuestionPassing string to stored procedure. Pin
meeram3951-Jul-10 21:40
meeram3951-Jul-10 21:40 
AnswerRe: Passing string to stored procedure. Pin
meeram3951-Jul-10 23:24
meeram3951-Jul-10 23:24 
Questiondisplay analog clock Pin
Hemant Thaker1-Jul-10 21:01
Hemant Thaker1-Jul-10 21:01 
AnswerRe: display analog clock Pin
Peace ON1-Jul-10 21:22
Peace ON1-Jul-10 21:22 
QuestionHow to Find character in ArrayList Pin
raju_shiva1-Jul-10 19:59
raju_shiva1-Jul-10 19:59 
AnswerRe: How to Find character in ArrayList Pin
ramzg1-Jul-10 20:11
ramzg1-Jul-10 20:11 
AnswerRe: How to Find character in ArrayList Pin
Keith Barrow1-Jul-10 21:06
professionalKeith Barrow1-Jul-10 21:06 
If you you are using .net3.0 or higher you can use this:

C++
List<string> list = new List<string>();
list.Add("AAA");
list.Add("AA");
list.Add("BB");
list.Add("BB");

//The code from you might find a better way of doing it depending upon your requirements!
foreach (string found in list.FindAll(x=> x=="AA"))
    comboBox1.Items.Add(value); 


The above code is one way if achieving what you want. The generic list (equivalent to a c++ template) has a few advantages, the list is strongly typed (in this case all elements are strings). Additionally the generic list has more methods allowing you to find stuff in the list over the old ArrayList. The only thing I'd say (and it's a drawback in the code snippet I've added) is that the predicate syntax looks a little weird if you aren't used to it: list.FindAll(x=> x=="AA")

See Generic List MSDN[^] for members of a generic lists if interested.
Dalek Dave: There are many words that some find offensive, Homosexuality, Alcoholism, Religion, Visual Basic, Manchester United, Butter.
Pete o'Hanlon: If it wasn't insulting tools, I'd say you were dumber than a bag of spanners.

AnswerRe: How to Find character in ArrayList Pin
DaveyM692-Jul-10 1:24
professionalDaveyM692-Jul-10 1:24 
Questionnamespace name 'ArrayList' could not be found Pin
raju_shiva1-Jul-10 18:48
raju_shiva1-Jul-10 18:48 
AnswerRe: namespace name 'ArrayList' could not be found Pin
Abhinav S1-Jul-10 18:56
Abhinav S1-Jul-10 18:56 
QuestionHow to find the character in list Pin
raju_shiva1-Jul-10 18:15
raju_shiva1-Jul-10 18:15 
AnswerRe: How to find the character in list Pin
Abhinav S1-Jul-10 18:53
Abhinav S1-Jul-10 18:53 
Generalget the list of all page labels(numbers) Pin
TweakBird1-Jul-10 17:45
TweakBird1-Jul-10 17:45 
QuestionUnhandled exception handler problem Pin
Super Lloyd1-Jul-10 15:45
Super Lloyd1-Jul-10 15:45 
AnswerRe: Unhandled exception handler problem Pin
Luc Pattyn1-Jul-10 17:05
sitebuilderLuc Pattyn1-Jul-10 17:05 
GeneralRe: Unhandled exception handler problem Pin
Super Lloyd1-Jul-10 19:16
Super Lloyd1-Jul-10 19:16 
QuestionVS2010 Chart Control [modified] Pin
It_tech1-Jul-10 8:54
It_tech1-Jul-10 8:54 
AnswerRe: VS2010 Chart Control PinPopular
Pete O'Hanlon1-Jul-10 13:13
mvePete O'Hanlon1-Jul-10 13:13 
GeneralRe: VS2010 Chart Control Pin
It_tech1-Jul-10 18:51
It_tech1-Jul-10 18:51 
GeneralRe: VS2010 Chart Control Pin
Daniel Grunwald2-Jul-10 0:37
Daniel Grunwald2-Jul-10 0:37 
GeneralRe: VS2010 Chart Control Pin
DaveyM692-Jul-10 1:35
professionalDaveyM692-Jul-10 1:35 
GeneralRe: VS2010 Chart Control Pin
Pete O'Hanlon2-Jul-10 2:23
mvePete O'Hanlon2-Jul-10 2:23 
Questionto handle Multiple clients.... Pin
yum 20101-Jul-10 8:08
yum 20101-Jul-10 8:08 
AnswerThe hardest part of dealing with mulitple clients Pin
Ennis Ray Lynch, Jr.1-Jul-10 8:27
Ennis Ray Lynch, Jr.1-Jul-10 8:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.