473,324 Members | 2,196 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Index was outside the bounds of the array

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
10 16591
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
"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
"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
"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
"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
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
"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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: kim | last post by:
Scenario (I'm a newbie): I have a datagrid with countries listed and 5 parameters in each row. I want to add a row to this datagrid via an Event Handler. Very basic stuff. This method then call a...
0
by: Eugene | last post by:
Hello all, I've been trying to figure this out for a few days now, and still have no clue what's going on... I have a few related tables in MS Access (Clients, Cars, Sales), and a datagrid,...
1
by: Joe | last post by:
This is a weird problem. when doing trying to add a tabpage to a tabcontrol I get an error: Index was outside the bounds of the array. Now this only happens when I call a function from within...
1
by: iCeCLoW | last post by:
Hi there, I´m using the rowFilter property for filtering the rows in a DataView object. If the filter is set to an inexistent value , that is, after filtering i have 0 rows in the DataView,...
0
by: scotthutchinson | last post by:
I have a .NET Remoting object hosted in IIS6 on Windows Server 2003 (happens before and after installing SP1) at an endpoint (ASP.NET application virtual folder) named "CompanyXYZReporting". The...
2
by: Denis C | last post by:
Hi there, I'm trying to convert part of a byte array into a series of fixed length strings but half way through the for loop I get an error that I'm accessing outside the buffer bounds. The...
0
by: Trapulo | last post by:
I've a datagrid filled with a collection of objects that inherits from basecollection. When I remove an item from this collection and then click onto the datagrid, I've always this error: ...
4
by: Antoine | last post by:
Herfried and Cor:- I used tracing and actually tracked down the code that was causing the problem most likely. I wonder if you wanted to comment on it. Also I wonder if there is a better way...
0
by: Beaker | last post by:
I am having some trouble with an array object and a web service I have. I have a farly simple user object public class User { private Guid myUserId; public Guid UserId { get { return...
4
by: weird0 | last post by:
I have no idea why this error this is coming and how can i fix it? Can anyone please help me with it..............? public static class BillManager { private static Object ExecuteSP(Object...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.