P
PJ6
I have a data source that returns an array of objects casted as an interface
type. The interface type is all I have, I do not have the implementing class
to cast as.
Below this is what GridView gives me in response.
What is it doing invoking Activator.CreateInstance? I can see where you
would want data copied to edit and perform validation when editing, but
that's what MemberwiseClone and Serialize/Deserialze is for. And I'm not
editing, this error is thrown on DataBind.
Also, the actual class that implements the interface *does* have a
parameterless constructor.
Is this a bug?
Paul
Server Error in '/' Application.
--------------------------------------------------------------------------------
No parameterless constructor defined for this object.
[MissingMethodException: No parameterless constructor defined for this
object.]
System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean
publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandle& ctor,
Boolean& bNeedSecurityCheck) +0
System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean
fillCache) +86
System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean
skipVisibilityChecks, Boolean fillCache) +230
System.Activator.CreateInstance(Type type, Boolean nonPublic) +67
System.Web.UI.WebControls.ObjectDataSourceView.InvokeMethod(ObjectDataSourceMethod method, Boolean disposeInstance, Object& instance) +139
System.Web.UI.WebControls.ObjectDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +1247
System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments,
DataSourceViewSelectCallback callback) +19
System.Web.UI.WebControls.DataBoundControl.PerformSelect() +142
System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +73
System.Web.UI.WebControls.GridView.DataBind() +4
VehicleWorkBench.Registrations.PopulateControls() in
C:\Resources\DEV\projects\VehicleWorkBench\VehicleWorkBench\Registrations.aspx.vb:17
VehicleWorkBench.Registrations.OnLoad(EventArgs e) in
C:\Resources\DEV\projects\VehicleWorkBench\VehicleWorkBench\Registrations.aspx.vb:10
System.Web.UI.Control.LoadRecursive() +50
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627
type. The interface type is all I have, I do not have the implementing class
to cast as.
Below this is what GridView gives me in response.
What is it doing invoking Activator.CreateInstance? I can see where you
would want data copied to edit and perform validation when editing, but
that's what MemberwiseClone and Serialize/Deserialze is for. And I'm not
editing, this error is thrown on DataBind.
Also, the actual class that implements the interface *does* have a
parameterless constructor.
Is this a bug?
Paul
Server Error in '/' Application.
--------------------------------------------------------------------------------
No parameterless constructor defined for this object.
[MissingMethodException: No parameterless constructor defined for this
object.]
System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean
publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandle& ctor,
Boolean& bNeedSecurityCheck) +0
System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean
fillCache) +86
System.RuntimeType.CreateInstanceImpl(Boolean publicOnly, Boolean
skipVisibilityChecks, Boolean fillCache) +230
System.Activator.CreateInstance(Type type, Boolean nonPublic) +67
System.Web.UI.WebControls.ObjectDataSourceView.InvokeMethod(ObjectDataSourceMethod method, Boolean disposeInstance, Object& instance) +139
System.Web.UI.WebControls.ObjectDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +1247
System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments,
DataSourceViewSelectCallback callback) +19
System.Web.UI.WebControls.DataBoundControl.PerformSelect() +142
System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +73
System.Web.UI.WebControls.GridView.DataBind() +4
VehicleWorkBench.Registrations.PopulateControls() in
C:\Resources\DEV\projects\VehicleWorkBench\VehicleWorkBench\Registrations.aspx.vb:17
VehicleWorkBench.Registrations.OnLoad(EventArgs e) in
C:\Resources\DEV\projects\VehicleWorkBench\VehicleWorkBench\Registrations.aspx.vb:10
System.Web.UI.Control.LoadRecursive() +50
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627