Click here to Skip to main content
15,913,610 members
Home / Discussions / C#
   

C#

 
GeneralRe: Add-In Pin
molesworth20-May-09 9:31
molesworth20-May-09 9:31 
QuestionDataBinding in ComboBox Pin
LiranViper20-May-09 6:20
LiranViper20-May-09 6:20 
AnswerRe: DataBinding in ComboBox Pin
Ian McCaul20-May-09 6:46
Ian McCaul20-May-09 6:46 
GeneralRe: DataBinding in ComboBox Pin
LiranViper20-May-09 22:37
LiranViper20-May-09 22:37 
Questiontreeview checkboxes Pin
ehsan salehi20-May-09 6:04
ehsan salehi20-May-09 6:04 
Questionremoting annoying Exception {"Found two different objects associated with the same URI, '/999013af_72e3_42b1_affa_43766d7f541f/Chat'."} [modified] Pin
michael@cohen20-May-09 5:57
michael@cohen20-May-09 5:57 
QuestionCrazy error Pin
Jonathan Harker20-May-09 5:31
Jonathan Harker20-May-09 5:31 
AnswerRe: Crazy error Pin
molesworth20-May-09 5:51
molesworth20-May-09 5:51 
Actually, it's not crazy. It's probably something like :-

foreach (Object obj in myCollection)
{
    // some code

    myCollection.Add(anotherobj);

    // some more code
}


and it's telling you that you can't add / remove / clear or whatever in the collection you're iterating over.

If you only ever want to add new items, you can use a "for (int loop=0; loop<myCollection.Count; ++loop)", although that will iterate over the new items as well.

Otherwise, create "Add" and "Remove" lists which can be processed after the main loop to add and remove as needed.

There are three kinds of people in the world - those who can count and those who can't...

AnswerRe: Crazy error Pin
DavidRRR20-May-09 5:54
DavidRRR20-May-09 5:54 
AnswerRe: Crazy error Pin
Dave Kreskowiak20-May-09 6:03
mveDave Kreskowiak20-May-09 6:03 
GeneralRe: Crazy error Pin
Jonathan Harker20-May-09 7:50
Jonathan Harker20-May-09 7:50 
GeneralRe: Crazy error Pin
Christian Graus20-May-09 8:00
protectorChristian Graus20-May-09 8:00 
QuestionConfig File Confusion Pin
BrianAshcroft20-May-09 4:42
BrianAshcroft20-May-09 4:42 
AnswerRe: Config File Confusion Pin
Alan N20-May-09 5:07
Alan N20-May-09 5:07 
GeneralRe: Config File Confusion Pin
BrianAshcroft20-May-09 5:45
BrianAshcroft20-May-09 5:45 
GeneralRe: Config File Confusion [modified] Pin
Alan N20-May-09 5:59
Alan N20-May-09 5:59 
QuestionDataGridView Size Pin
m1220-May-09 4:25
m1220-May-09 4:25 
AnswerRe: DataGridView Size Pin
TheFoZ20-May-09 4:32
TheFoZ20-May-09 4:32 
GeneralRe: DataGridView Size Pin
m1220-May-09 4:39
m1220-May-09 4:39 
GeneralRe: DataGridView Size Pin
Alan N20-May-09 4:47
Alan N20-May-09 4:47 
AnswerRe: DataGridView Size Pin
musefan20-May-09 4:39
musefan20-May-09 4:39 
GeneralRe: DataGridView Size Pin
m1220-May-09 4:45
m1220-May-09 4:45 
AnswerRe: DataGridView Size Pin
Dave Kreskowiak20-May-09 6:00
mveDave Kreskowiak20-May-09 6:00 
QuestionRelative file path referencing problem Pin
Jacobus0120-May-09 4:09
Jacobus0120-May-09 4:09 
AnswerRe: Relative file path referencing problem Pin
Dave Kreskowiak20-May-09 5:58
mveDave Kreskowiak20-May-09 5:58 

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.