Thursday, 15 January 2015

c# - Exception handling help -


I've written and tested a WinForms application and everything works fine on my machine (Cliche, I know ). When I created a setup project and installed it on a co-worker machine, it receives the following message:

  **************************** Exception text ** ************ System.IndexOutOfRangeException: there System.Data.RBTree`1.GetNodeByIndex (Int32 userIndex) position 0. on (Int32 on System.Data.RBTree`1.get_Item a row System.Windows.Forms.Form.OnLoad (EventArgs e) System.Data.DataRowCollection.get_Item (Int32 index on System.Windows.Forms.Form) on MyApp.MainForm.MainForm_Load (object sender, EventArgs e) Index). OnCreateControl () System.Windows.Forms.Control.CreateControl on System.Windows.Forms.Control.CreateControl () on System.Windows.Forms.Control.WmShowWindow (Boolean fIgnoreVisible) (message & amp; System.Windows meters) in KControlkWndProc (message .Forms & amp; m) in (message System.Windows.Forms.ScrollableControl.WndProc & amp; m) in (message System.Windows.Forms.ContainerControl.WndProc & amp; m ) in (message System.Windows.Forms.Form.WmShowWindow & amp; m) (message System.Windows.Forms.Control.ControlNativeWindow.WndProc & amp ;; System.Windows.Forms.Control.ControlNativeWindow.OnMessage M) (Message & amp; System.Windows.Forms.Form.WandProc (meters on message & m)) System.Windows.Forms.NativeWindow.Callback (IntPtr hWnd, Int32 Sense I, at IntPtr wParam, IntPtr lParam)  

I believe that I am just beginning when it comes to the exception of dealing with this one. The text is not fully understood to me and I am the best way to debug it, because I can not get the error on my machine.

Can anyone say that the problem is this, or do I have the best advice to debug? Any help is greatly appreciated!

You are apparently using the DataRowCollection object in your main form Load event handler, and this DataRowCollection object is empty (i.e. there is no line in it). Form load event handler assumes that it will not be empty.

I would suggest that you Set breakpoints (F9) on the opening brace of MainForm_Load and phase (F-10 or F-11) until you find the code that code Attempts to use the DataRowCollection .


No comments:

Post a Comment