traversing down the constructors from base class - SystemIndexOutofRangeException - system.data.dll

H

hazz

My runtime in debug is dropping through the constructors from an upper level
class into subclassed constructors.....

namespace AB
public class A : MarshalByRefObject
public A () //ctor for A
{ System.Diagnostics.Debug.WriteLine(" A ctor - no
; } <-- first stop.
public class B : A
{ public B () } //ctor for B
<-- second stop.

namespace DA
public class DABase : B
{ public DABase() } //ctor for DABase
<-- third stop.

public class AV : DABase, IAV
{
public AV(Token token) //ctor for AV
{
//statement or no statement, result still the same
<-- last stop before exception
} // SystemIndexOutofRangeException - system.data.dll -there is no
row at position 0


Why system.data?
System.Data is referenced in these projects but why would system.data.dll be
involved in the exception during the downward constructor traversal?
Note: class AV is the class that was called by the client passing a
parameter whose constructor with that signature is never reached.
here is what starts the process - AV m_AV= new AV(tkn);

Thank you for any ideas....?

-Greg
 
H

hazz

My runtime in debug is dropping through the constructors from an upper level
class into subclassed constructors.....

namespace AB
public class A : MarshalByRefObject
public { A () } //ctor <-- first stop.

public class B : A
{ public B () } //ctor <-- second stop.

namespace DA
public class DABase : B
{ public DABase() } //ctor <-- third stop.

public class AV : DABase, IAV
{
public AV(Token token) //ctor for AV
{ //statement or no statement, result still the same } <-- last stop
before exception
-> SystemIndexOutofRangeException - system.data.dll -there is no row at
position 0


Why system.data?
System.Data is referenced in these projects but why would system.data.dll be
involved in the exception during the downward constructor traversal?
Note: class AV is the class that was called by the client passing a
parameter whose constructor with that signature is never reached.
here is what starts the process - AV m_AV= new AV(tkn);

Thank you for any ideas. -Greg
 
J

Jon Skeet [C# MVP]

hazz said:
My runtime in debug is dropping through the constructors from an
upper level class into subclassed constructors.....

} // SystemIndexOutofRangeException - system.data.dll -there is no
row at position 0


Why system.data?
System.Data is referenced in these projects but why would system.data.dll be
involved in the exception during the downward constructor traversal?

I suspect it's in the code that you snipped.

Could you post a short but complete program which demonstrates the
problem?

See http://www.pobox.com/~skeet/csharp/complete.html for details of
what I mean by that.
 
H

hazz

Unhandled Exception: System.IndexOutOfRangeException: There is no row at
position 0.
at System.Data.DataRowCollection.get_Item(Int32 index)
at ServiceControl.MainForm.CheckDownload_Click(Object sender, EventArgs
e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons
button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd,
Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at
System.Windows.Forms.ComponentManager.System.Windows.Forms.UnsafeNativeMetho
ds+IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason,
Int32 pvLoopData)
at System.Windows.Forms.ThreadContext.RunMessageLoopInner(Int32 reason,
ApplicationContext context)
at System.Windows.Forms.ThreadContext.RunMessageLoop(Int32 reason,
ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at ServiceControl.MainForm.Main()The program '[3376] ServiceControl.exe'
has exited with code 0 (0x0).
 
M

Marina

Yes.

This has nothing to do with constructors.

According to the message, in the CheckDownload_Click event handler, someone
is trying to get a row out of a datatable.

This is exactly what one would expect, given the message you reported.
 
H

hazz

Thank you Marina. It was an interesting excercise documenting the class
hierachy, whose constructors had just changed significantly....but I
wholeheartedly agree with you after looking at the log. I believe the
exception being thrown was at the callee's entry point when the object was
instantiated.
Appreciatively,
-greg

Marina said:
Yes.

This has nothing to do with constructors.

According to the message, in the CheckDownload_Click event handler, someone
is trying to get a row out of a datatable.

This is exactly what one would expect, given the message you reported.

hazz said:
Unhandled Exception: System.IndexOutOfRangeException: There is no row at
position 0.
at System.Data.DataRowCollection.get_Item(Int32 index)
at ServiceControl.MainForm.CheckDownload_Click(Object sender, EventArgs
e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons
button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd,
Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at
System.Windows.Forms.ComponentManager.System.Windows.Forms.UnsafeNativeMetho
ds+IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason,
Int32 pvLoopData)
at System.Windows.Forms.ThreadContext.RunMessageLoopInner(Int32 reason,
ApplicationContext context)
at System.Windows.Forms.ThreadContext.RunMessageLoop(Int32 reason,
ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at ServiceControl.MainForm.Main()The program '[3376] ServiceControl.exe'
has exited with code 0 (0x0).
 
H

hazz

Thanks Jon,
Just talking through it and receiving Marina's answer was enough to have me
seek help internally within my company to get at the root. That is the end
of this thread. -greg
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top