473,405 Members | 2,310 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,405 software developers and data experts.

"Index was outside the bounds of the array" error out of nowhere

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, binded to dataview.
Here's a catch - whenever I select a client, and then find a car which
belongs to this client, and click on empty space in datagrid (that is
in gray area below rows) - I get "Index was outside the bounds of the
array" error...
Works only in that order. Selecting the same car without finding
Client first works fine.
I even wrapped the Main in try-catch block - it's not being handled.
Drives me nuts.
Anyone have any suggestions ?
Below is the full error message I get (if it helps)
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.IndexOutOfRangeException: Index was outside the bounds of the
array.
at System.Windows.Forms.DataGrid.Edit(String instantText)
at System.Windows.Forms.DataGrid.Edit()
at System.Windows.Forms.DataGrid.OnEnter(EventArgs e)
at System.Windows.Forms.Control.NotifyEnter()
at System.Windows.Forms.ContainerControl.UpdateFocuse dControl()
************** Loaded Assemblies **************
mscorlib
Assembly Version: 1.0.3300.0
Win32 Version: 1.0.3705.288
CodeBase: file:///c:/winnt/microsoft.net/framework/v1.0.3705/mscorlib.dll
----------------------------------------
KCC_TABS
Assembly Version: 1.0.1573.30624
Win32 Version: 1.0.1573.30624
CodeBase: file:///D:/Projects/KCC_TABS/bin/Debug/KCC_TABS.exe
----------------------------------------
System.Windows.Forms
Assembly Version: 1.0.3300.0
Win32 Version: 1.0.3705.288
CodeBase: file:///c:/winnt/assembly/gac/system.windows.forms/1.0.3300.0__b77a5c561934e089/system.windows.forms.dll
----------------------------------------
System
Assembly Version: 1.0.3300.0
Win32 Version: 1.0.3705.288
CodeBase: file:///c:/winnt/assembly/gac/system/1.0.3300.0__b77a5c561934e089/system.dll
----------------------------------------
System.Drawing
Assembly Version: 1.0.3300.0
Win32 Version: 1.0.3705.288
CodeBase: file:///c:/winnt/assembly/gac/system.drawing/1.0.3300.0__b03f5f7f11d50a3a/system.drawing.dll
----------------------------------------
System.Data
Assembly Version: 1.0.3300.0
Win32 Version: 1.0.3705.288
CodeBase: file:///c:/winnt/assembly/gac/system.data/1.0.3300.0__b77a5c561934e089/system.data.dll
----------------------------------------
System.Xml
Assembly Version: 1.0.3300.0
Win32 Version: 1.0.3705.288
CodeBase: file:///c:/winnt/assembly/gac/system.xml/1.0.3300.0__b77a5c561934e089/system.xml.dll
----------------------------------------
Accessibility
Assembly Version: 1.0.3300.0
Win32 Version: 1.0.3705.0
CodeBase: file:///c:/winnt/assembly/gac/accessibility/1.0.3300.0__b03f5f7f11d50a3a/accessibility.dll
----------------------------------------
System.EnterpriseServices
Assembly Version: 1.0.3300.0
Win32 Version: 1.0.3705.288
CodeBase: file:///c:/winnt/assembly/gac/system.enterpriseservices/1.0.3300.0__b03f5f7f11d50a3a/system.enterpriseservices.dll
----------------------------------------

************** JIT Debugging **************
To enable just in time (JIT) debugging, the config file for this
application or machine (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
<system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the machine
rather than being handled by this dialog.
Nov 16 '05 #1
1 2144
I think I fixed it..
Still not quite sure what caused it, though.
Basically, before searching for a new item I would empty all tables in
dataset to remove all results from previous search using
Table[0].Clear();
Now I'm deleting tables completely using Tables.Remove("Name"); which
made the problem go away.
Still, if anyone has an explanation to it - I would like to hear it.

Best regards,
me.
Nov 16 '05 #2

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,...
2
by: David Laub | last post by:
A transform that works fine in XMLSPy fails when I run it under dot net. I've run many other transforms successfully in dot net so there is something "special" about this transform I just...
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...
3
by: writebrent | last post by:
I wrote a little interface for users to post data to a website. On their local machines, it produces CSV from an Excel spreadsheet, then posts it to the site. In some cases, the CSV will contain...
15
by: bill | last post by:
I am trying to write clean code but keep having trouble deciding when to quote an array index and when not to. sometimes when I quote an array index inside of double quotes I get an error about...
0
by: Knightxtech | last post by:
I keep getting an out of bounds error message when I have selected the last record on the datagrid (by code) then try and move up in the datagrid using the scroll bar. I dont have any code to...
5
by: Pseudonyme | last post by:
Dear All : Ever had an httpd error_log bigger than the httpd access log ? We are using Linux-Apache-Fedora-Httpd 2006 configuration. The PHP lines code that lead too tons of errors are : ...
3
by: kalaivani572 | last post by:
i am getting "Index was outside the bounds of the array." error when i try to get the checked items from list view. the code is private void btnFinish_Click(object sender, EventArgs e) {...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.