My runtime in debug is dropping through the constructors from an upper level
class into subclassed constructors... ..
namespace AB
public class A : MarshalByRefObj ect
public A () //ctor for A
{ System.Diagnost ics.Debug.Write Line(" 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
} // SystemIndexOuto fRangeException - 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 6 1523
My runtime in debug is dropping through the constructors from an upper level
class into subclassed constructors... ..
namespace AB
public class A : MarshalByRefObj ect
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
-> SystemIndexOuto fRangeException - 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
hazz <ha**@sonic.net > wrote: My runtime in debug is dropping through the constructors from an upper level class into subclassed constructors... ..
<snip>
} // SystemIndexOuto fRangeException - 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.
--
Jon Skeet - <sk***@pobox.co m> http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Unhandled Exception: System.IndexOut OfRangeExceptio n: There is no row at
position 0.
at System.Data.Dat aRowCollection. get_Item(Int32 index)
at ServiceControl. MainForm.CheckD ownload_Click(O bject sender, EventArgs
e)
at System.Windows. Forms.Control.O nClick(EventArg s e)
at System.Windows. Forms.Button.On Click(EventArgs e)
at System.Windows. Forms.Button.On MouseUp(MouseEv entArgs mevent)
at System.Windows. Forms.Control.W mMouseUp(Messag e& m, MouseButtons
button, Int32 clicks)
at System.Windows. Forms.Control.W ndProc(Message& m)
at System.Windows. Forms.ButtonBas e.WndProc(Messa ge& m)
at System.Windows. Forms.Button.Wn dProc(Message& m)
at System.Windows. Forms.ControlNa tiveWindow.OnMe ssage(Message& m)
at System.Windows. Forms.ControlNa tiveWindow.WndP roc(Message& m)
at System.Windows. Forms.NativeWin dow.DebuggableC allback(IntPtr hWnd,
Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows. Forms.UnsafeNat iveMethods.Disp atchMessageW(MS G& msg)
at
System.Windows. Forms.Component Manager.System. Windows.Forms.U nsafeNativeMeth o
ds+IMsoComponen tManager.FPushM essageLoop(Int3 2 dwComponentID, Int32 reason,
Int32 pvLoopData)
at System.Windows. Forms.ThreadCon text.RunMessage LoopInner(Int32 reason,
ApplicationCont ext context)
at System.Windows. Forms.ThreadCon text.RunMessage Loop(Int32 reason,
ApplicationCont ext context)
at System.Windows. Forms.Applicati on.Run(Form mainForm)
at ServiceControl. MainForm.Main() The program '[3376] ServiceControl. exe'
has exited with code 0 (0x0).
Yes.
This has nothing to do with constructors.
According to the message, in the CheckDownload_C lick 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" <ha**@sonic.net > wrote in message
news:eQ******** *****@TK2MSFTNG P10.phx.gbl... Unhandled Exception: System.IndexOut OfRangeExceptio n: There is no row at position 0. at System.Data.Dat aRowCollection. get_Item(Int32 index) at ServiceControl. MainForm.CheckD ownload_Click(O bject sender, EventArgs e) at System.Windows. Forms.Control.O nClick(EventArg s e) at System.Windows. Forms.Button.On Click(EventArgs e) at System.Windows. Forms.Button.On MouseUp(MouseEv entArgs mevent) at System.Windows. Forms.Control.W mMouseUp(Messag e& m, MouseButtons button, Int32 clicks) at System.Windows. Forms.Control.W ndProc(Message& m) at System.Windows. Forms.ButtonBas e.WndProc(Messa ge& m) at System.Windows. Forms.Button.Wn dProc(Message& m) at System.Windows. Forms.ControlNa tiveWindow.OnMe ssage(Message& m) at System.Windows. Forms.ControlNa tiveWindow.WndP roc(Message& m) at System.Windows. Forms.NativeWin dow.DebuggableC allback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) at System.Windows. Forms.UnsafeNat iveMethods.Disp atchMessageW(MS G& msg) at
System.Windows. Forms.Component Manager.System. Windows.Forms.U nsafeNativeMeth o ds+IMsoComponen tManager.FPushM essageLoop(Int3 2 dwComponentID, Int32
reason, Int32 pvLoopData) at System.Windows. Forms.ThreadCon text.RunMessage LoopInner(Int32 reason, ApplicationCont ext context) at System.Windows. Forms.ThreadCon text.RunMessage Loop(Int32 reason, ApplicationCont ext context) at System.Windows. Forms.Applicati on.Run(Form mainForm) at ServiceControl. MainForm.Main() The program '[3376]
ServiceControl. exe' has exited with code 0 (0x0).
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" <so*****@nospam .com> wrote in message
news:Ob******** ******@TK2MSFTN GP10.phx.gbl... Yes.
This has nothing to do with constructors.
According to the message, in the CheckDownload_C lick 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" <ha**@sonic.net > wrote in message news:eQ******** *****@TK2MSFTNG P10.phx.gbl... Unhandled Exception: System.IndexOut OfRangeExceptio n: There is no row at position 0. at System.Data.Dat aRowCollection. get_Item(Int32 index) at ServiceControl. MainForm.CheckD ownload_Click(O bject sender,
EventArgs e) at System.Windows. Forms.Control.O nClick(EventArg s e) at System.Windows. Forms.Button.On Click(EventArgs e) at System.Windows. Forms.Button.On MouseUp(MouseEv entArgs mevent) at System.Windows. Forms.Control.W mMouseUp(Messag e& m, MouseButtons button, Int32 clicks) at System.Windows. Forms.Control.W ndProc(Message& m) at System.Windows. Forms.ButtonBas e.WndProc(Messa ge& m) at System.Windows. Forms.Button.Wn dProc(Message& m) at System.Windows. Forms.ControlNa tiveWindow.OnMe ssage(Message& m) at System.Windows. Forms.ControlNa tiveWindow.WndP roc(Message& m) at System.Windows. Forms.NativeWin dow.DebuggableC allback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) at System.Windows. Forms.UnsafeNat iveMethods.Disp atchMessageW(MS G&
msg) at
System.Windows. Forms.Component Manager.System. Windows.Forms.U nsafeNativeMeth o ds+IMsoComponen tManager.FPushM essageLoop(Int3 2 dwComponentID, Int32 reason, Int32 pvLoopData) at System.Windows. Forms.ThreadCon text.RunMessage LoopInner(Int32
reason, ApplicationCont ext context) at System.Windows. Forms.ThreadCon text.RunMessage Loop(Int32 reason, ApplicationCont ext context) at System.Windows. Forms.Applicati on.Run(Form mainForm) at ServiceControl. MainForm.Main() The program '[3376] ServiceControl. exe' has exited with code 0 (0x0).
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
"Jon Skeet [C# MVP]" <sk***@pobox.co m> wrote in message
news:MP******** *************** *@msnews.micros oft.com... hazz <ha**@sonic.net > wrote: My runtime in debug is dropping through the constructors from an upper level class into subclassed constructors... ..
<snip>
} // SystemIndexOuto fRangeException - 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.
-- Jon Skeet - <sk***@pobox.co m> http://www.pobox.com/~skeet If replying to the group, please do not mail me too This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Beach Potato |
last post by:
I guess I've been out of C++ for a while, since right now I don't seem
to get a simple solution for overriding inherited constrictors.
What worked in Borland C++ & Pascal (and Java, if I remember correctly) as:
-------------------------------------------
class Base { public: Base(); };
Base::Base() { printf("Base"); }
class Derived : Base { public: Derived(); override; };
Derived::Derived() { /*inherited;*/ printf("Derived"); }
|
by: Edward Diener |
last post by:
Coming from the C++ world I can not understand the reason why copy
constructors are not used in the .NET framework. A copy constructor creates
an object from a copy of another object of the same kind. It sounds simple
but evidently .NET has difficulty with this concept for some reason. I do
understand that .NET objects are created on the GC heap but that doesn't
mean that they couldn't be copied from another object of the same kind when...
|
by: SLE |
last post by:
Hi there,
I know constructors are not inherited from the base class, not in VB.NET nor
C# (nor Java I suppose). I never wondered,but reflecting on the reason why,
I cannot find a solid answer.
Is the reason technical (compiler or CLR limitation) or logical (OOP best
practices)?
Any feedback would be greatly appreciated.
|
by: Tony Johansson |
last post by:
Hello!!
Assume you have two classes one class called Base which is an abstract class
and one
derived class called Derived.
You are not allowed to create an object of class Base like new Base(); or
just Base base;.
But when you instansiate an object of class Derived the constructor in Base
is called implicitly.
|
by: Fernando Rodríguez |
last post by:
Hi,
If I try to compile the code below, I get a weird error that seems to be
related with hte constructors.
-------------------------------------
class Action : System.Object
{
Object _something;
| |
by: PIEBALD |
last post by:
OK, here's my latest workaround for the lack of inherited constructors...
It requires that the class have a parameterless (default) constructor and a
public virtual "Initialize" method (which returns its "this"). An instance
(in this case a Number) is constructed and initialized like so:
Number n = ((Number)((Number)
typeof(Number).GetConstructor(System.Type.EmptyTypes).Invoke(new
object{})).Initialize(1)) ;
|
by: craigkenisston |
last post by:
Hi,
I have a class with 3 constructors, one takes no arguments, other take
an string and other an xml document.
I want to derive another class of it, I don't need a different
constructor so I didn't override nor rewrite any of its constructors.
When I try to compile I get the error :
No overloaded method for "MyDerivedClassConstructor" takes 1 argument.
|
by: lars.uffmann |
last post by:
Hey everyone!
I am (still) working on a project that I took over from former
students, so don't blame me for the criminal approach on coding *g*
The problem I have is fairly easy and while I have solutions, none of
them seems really "clean" to me and I was wondering if someone here
maybe had a better idea:
class geometry { ... }
|
by: Hemanth |
last post by:
Hi,
I have a base class with a static constructor and some abstract methods.
Derived classes implement these methods. From articles on the web, it appears
that there is no guarentee that this static constructor of the base class
would be invoked even if a an object of the derived class is created. Is this
correct ? Is there any way to ensure the base class's static constructor is
invoked before the derived class instance is constructed ?...
|
by: A n g l e r |
last post by:
Hi all.
I'm facing the following construction:
class ClOld
{
public ClOld(string a) { ... }
}
class ClNew: ClOld
|
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |