Exception:System.IndexOutOfRangeException (Urgent)
-
Why do you say that. (NB. the forum cut off everything after "for(int i=0;i" the line should have read "for(int i=0;i<count;i++)")
It is a good notice from you X| But i didn't know that the forum cut that out. Why don't u try to help that poor guy instead of loosing your time on unrelavent comments
-
i've already checked that the number of items selected in the listbox are 4 through
int count=TableListBox.CheckedIndices.Count;
approach. but still it doesn't work. Any other suggestions???Sorry, i cann't see any error in the code you are providing. Try providing us more information and maybe we can help
-
Sorry, i cann't see any error in the code you are providing. Try providing us more information and maybe we can help
can this be due to the .Net Platform being corrupt? i'm really confused:confused::~
-
can this be due to the .Net Platform being corrupt? i'm really confused:confused::~
Is it the first time you develop on this Platform?
-
can this be due to the .Net Platform being corrupt? i'm really confused:confused::~
The odds of that are close to zero.
Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog
-
hi friends can anyone plz guide me on the exception
An unhandled exception of type 'System.IndexOutOfRangeException' occurred in system.windows.forms.dll Additional information: Index was outside the bounds of the array.
heres the code that gives me the exceptionint count=4; int[] indice = new int[count]; MessageBox.Show(count.ToString()); for(int i=0;i<--Exception return indice;
plz reply quicklySaira Tanwir wrote:
plz reply quickly
This really bugs me. You're getting help for free, people will reply when they reply. No-one is 'on duty' int count=4; int[] indice = new int[count]; MessageBox.Show(count.ToString()); for(int i=0;i
-
The odds of that are close to zero.
Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog
thankyou for clearing that up and YES this is my first project on this platform
-
Saira Tanwir wrote:
plz reply quickly
This really bugs me. You're getting help for free, people will reply when they reply. No-one is 'on duty' int count=4; int[] indice = new int[count]; MessageBox.Show(count.ToString()); for(int i=0;i
well guys the problem is still there:^) But thanks anyway for all thee help and ur precious time regards:rose: Saira
-
well guys the problem is still there:^) But thanks anyway for all thee help and ur precious time regards:rose: Saira
Well, it's a really simple one. You need to step through the code and see what's happening, if you need to do that, to be convinced that hard coding the number 4 when the list could have less items is a bad idea. You'll see that it blows up because there are not four items checked. Nothing else makes sense.
Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog
-
i've already checked that the number of items selected in the listbox are 4 through
int count=TableListBox.CheckedIndices.Count;
approach. but still it doesn't work. Any other suggestions???paste the full code i will test and let u know