By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,506 Members | 1,881 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,506 IT Pros & Developers. It's quick & easy.

Index was outside the bounds of the array

P: n/a
I can't work out what is causing this problem. Can anyone suggest what the
typical causes beyond the obvious might be? Could you get it with datasets?
Maybe I should run in debug mode and test certain bits of code for
"erroneous" and unpredictable values?
Many thanks!

"An unhandled exception was generated during the execution of the current
web request. Information regarding the origin and location of the exception
can be identified using the exception stack trace below.

Stack Trace:

[IndexOutOfRangeException: Index was outside the bounds of the array.]
System.Array.InternalGetValue(Int32 index1, Int32 index2, Int32 index3)
+0
System.Array.GetValue(Int32 index) +32
Microsoft.VisualBasic.CompilerServices.LateBinding .LateIndexGet(Object o,
Object[] args, String[] paramnames) +187
sharedcal.ShareCal.o() +655
sharedcal.ShareCal.Page_Load(Object o, EventArgs e) +799
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +750

Nov 21 '05 #1
Share this Question
Share on Google+
10 Replies


P: n/a
Antoine,

The first thing you can do is set in top of your program file (vb code)

Option Strict On

Maybe than you see some errors.

I hope this helps?

Cor

"Antoine" <mf****@dsl-spam.pipex.com>
...
I can't work out what is causing this problem. Can anyone suggest what the
typical causes beyond the obvious might be? Could you get it with
datasets?
Maybe I should run in debug mode and test certain bits of code for
"erroneous" and unpredictable values?
Many thanks!

"An unhandled exception was generated during the execution of the current
web request. Information regarding the origin and location of the
exception
can be identified using the exception stack trace below.

Stack Trace:

[IndexOutOfRangeException: Index was outside the bounds of the array.]
System.Array.InternalGetValue(Int32 index1, Int32 index2, Int32 index3)
+0
System.Array.GetValue(Int32 index) +32
Microsoft.VisualBasic.CompilerServices.LateBinding .LateIndexGet(Object
o,
Object[] args, String[] paramnames) +187
sharedcal.ShareCal.o() +655
sharedcal.ShareCal.Page_Load(Object o, EventArgs e) +799
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +750


Nov 21 '05 #2

P: n/a
"Antoine" <mf****@dsl-spam.pipex.com> schrieb:
I can't work out what is causing this problem. Can anyone suggest what the
typical causes beyond the obvious might be? Could you get it with
datasets?
Maybe I should run in debug mode and test certain bits of code for
"erroneous" and unpredictable values?


Yes, you should to that. Without seeing some code it's impossble to solve
the problem.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #3

P: n/a
"Cor Ligthert" <no************@planet.nl> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
Antoine,

The first thing you can do is set in top of your program file (vb code)

Option Strict On

Maybe than you see some errors.

I hope this helps?

Cor


Thank you. But It needs to work in a remote scenario, without the debugger.
Would this have any impact ?
I sent the PDB to one guy who has the problem. However unlike my IIS test
virtual directory, which reveals linenumbers when it fails - his didn't.
Do you think the above might help with that, if I recompiled with it on (and
then did my dotfuscate) ?

Otherwise I am going to have to try putting in something like individual
debug writelines at various points in the code, so it can hopefully trap
where roughly its at when it fails. But I have never done this, because I
had some problems with it recognising the debug.writeln command even after I
explicitly used imports system.diagnostics.debug etc.

The thing is, other that referring to rows within a dataset via an integer
value, I don't know of anywhere else it might get this error as they are
pretty bulletproof and trapped ranges eg something like

dim string test as string()
string(1) = "test1"
string(2) = "test2"
for i = 0 to 2
if othervalue = i then otherstring = string(i)

end for
Nov 21 '05 #4

P: n/a
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
"Antoine" <mf****@dsl-spam.pipex.com> schrieb:
I can't work out what is causing this problem. Can anyone suggest what the typical causes beyond the obvious might be? Could you get it with
datasets?
Maybe I should run in debug mode and test certain bits of code for
"erroneous" and unpredictable values?


Yes, you should to that. Without seeing some code it's impossble to solve
the problem.


Thanks. Is there any easy way (using vb.net and asp.net technolgies) that I
could add trace of the problem to my project when debugging, eg even a rough
line would help? I tried sending the pdb to a person with the problem but it
did not reveal the line during debug, just the same error as before.
Nov 21 '05 #5

P: n/a
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
"Antoine" <mf****@dsl-spam.pipex.com> schrieb:
I can't work out what is causing this problem. Can anyone suggest what the typical causes beyond the obvious might be? Could you get it with
datasets?
Maybe I should run in debug mode and test certain bits of code for
"erroneous" and unpredictable values?


Yes, you should to that. Without seeing some code it's impossble to solve
the problem.


I should add that part of the frustration is I can't replicate it ( well I
did for a very short interval when ran as a runtime version from a demo
virtual directory, but then recompiled again and it went away, but the guys
still say they have it though my deployments dont).

I couldn't debug also without slightly modifiying code because I have been
having SOAP problems so have to alter the code for a specific username when
in the debugger, as opposed to during the demo virtual test (which might be
an Active Directory problem). A wierd little issue but when its compiled it
uses the default credentials anyway.

So frustratingly, even though it happened for an inteval for myself, I was
unable to replicate further and reprudce it for debugging and the build is
currently ok now when run (though not at his site). So I really need some
other debug techniques I havent tried, that will work remotely.
Thanks

Antoine
Nov 21 '05 #6

P: n/a
Antoine,
dim string test as string()

This does for sure not work

dim test(2) as string

Maybe this does, however better is to have a look for this to the arraylist

http://msdn.microsoft.com/library/de...classtopic.asp

I hope this helps?

Cor
Nov 21 '05 #7

P: n/a
"Antoine" <mf****@dsl-spam.pipex.com> schrieb:
The thing is, other that referring to rows within a dataset via an integer
value, I don't know of anywhere else it might get this error as they are
pretty bulletproof and trapped ranges eg something like

dim string test as string()
string(1) = "test1"
string(2) = "test2"
for i = 0 to 2
if othervalue = i then otherstring = string(i)

end for


This code doesn't even compile!

\\\
Dim Test() As String = {"test1", "test2"}
For i As Integer = 0 To Test.Length - 1
If OtherValue = i Then
OtherString = Test(i)
End If
Next i
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #8

P: n/a
Sorry as I indicated it was an example and off the top of my head the best I
could do to approximate what I am doing. I am only new to VB.NET.
You obviously have the idea. That is not the issue, as my code does compile
but I dont have it to hand. Its a matter of what could it be, since the sort
of example below could not possible cause this error could it?
Thanks
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:eM**************@TK2MSFTNGP12.phx.gbl...
"Antoine" <mf****@dsl-spam.pipex.com> schrieb:
The thing is, other that referring to rows within a dataset via an integer value, I don't know of anywhere else it might get this error as they are
pretty bulletproof and trapped ranges eg something like

dim string test as string()
string(1) = "test1"
string(2) = "test2"
for i = 0 to 2
if othervalue = i then otherstring = string(i)

end for


This code doesn't even compile!

\\\
Dim Test() As String = {"test1", "test2"}
For i As Integer = 0 To Test.Length - 1
If OtherValue = i Then
OtherString = Test(i)
End If
Next i
///

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #9

P: n/a
Thanks. Actually that was an approximation of the code, so you are right its
not correct, but thats not my issue. My issue is that written correctly
(like the code which I do not have to hand) surely it would NEVER cause this
issue and therefore I was wondering what else might cause it unless there is
any way that certain conditions could cause it to fail ?

I have just got turned on to tracing - this is an excellent guide. I may try
that.

http://www.informit.com/guides/conte...net&seqNum=217

"Cor Ligthert" <no************@planet.nl> wrote in message
news:eZ**************@TK2MSFTNGP15.phx.gbl...
Antoine,
dim string test as string() This does for sure not work

dim test(2) as string

Maybe this does, however better is to have a look for this to the

arraylist
http://msdn.microsoft.com/library/de...classtopic.asp
I hope this helps?


Nov 21 '05 #10

P: n/a
Dim actvtypearray(3) As String
actvtypearray(0) = "Phone Call"
actvtypearray(1) = "Appointment"
actvtypearray(2) = "Task"

Dim intcounter2 As Integer
For intcounter2 = 0 To 2
If
datasettest.Tables("result").Rows(intCounter).Item ("item1") =
actvtypearray(intcounter2) Then
dataRow("link") =
Convert.ToString(intcounter2)
End If
Next
Nov 21 '05 #11

This discussion thread is closed

Replies have been disabled for this discussion.