on 23-9-2008, Julia B supposed :
Usually that errormessage means that you derived a class from a
baseclass that has no parameterless constructors.
Always when you call a constructor, a constructor of a baseclass is
also executed (before your own construcor executes). If you don't call
one explicitly, the parameterless constructor is called automatically.
I don't know what the VB syntax is. In C# it would be something like:
class MyClass: MyBaseClass
{
// MyBaseClass is a baseclass for this class and
// has a constructor with one 'int' parameter
// constructor that explicitly calls a constructor of the baseclass
public MyClass(int aValue): base(aValue)
{
// further processing as needed
}
}
Hans Kesting
Apologies for the cross posting. I posted to the datagrid group a couple of
weeks ago, but haven't got an answer so am trying here.
>
weeks ago, but haven't got an answer so am trying here.
>
>
I'm trying to load some data into a dataview, with a datasource that is an
ObjectDataSourc e object and getting the message "No parameterless constructor
defined for this object". Basically the webform is in tier 1, which calls a
function called DisplayUsers in tier 2 (within the Users class), which in
turn calls a couple of functions/subs in tier 3. This is how it's set up.
>
I'm trying to load some data into a dataview, with a datasource that is an
ObjectDataSourc e object and getting the message "No parameterless constructor
defined for this object". Basically the webform is in tier 1, which calls a
function called DisplayUsers in tier 2 (within the Users class), which in
turn calls a couple of functions/subs in tier 3. This is how it's set up.
>
baseclass that has no parameterless constructors.
Always when you call a constructor, a constructor of a baseclass is
also executed (before your own construcor executes). If you don't call
one explicitly, the parameterless constructor is called automatically.
I don't know what the VB syntax is. In C# it would be something like:
class MyClass: MyBaseClass
{
// MyBaseClass is a baseclass for this class and
// has a constructor with one 'int' parameter
// constructor that explicitly calls a constructor of the baseclass
public MyClass(int aValue): base(aValue)
{
// further processing as needed
}
}
Hans Kesting
Comment