ObjectDataSource typedObject Insert error "parameterless construct

E

elburze

I am using a gridview [only to view(select)] and a formview [to insert]
some data. My gridview displays information correctly, but clicking on insert
button for the formview gives me error: "No parameterless constructor defined
for this object".

Data are persisted in a hiddentextbox as Xml and are used to create a
globally declared Dataset on page_load(). I have a dataObjectType class
"DataSetWrapper" and a static data access class "TendersDataSetAccessMethods"
[ofcurse, methods have parameter of type "DataSetWrapper"].

I add the insert parameter on formview's itemInserting event
(objdataSource's Inserting event seems to be too late).
can someone tell me please which object has no parameterless constructor?!!
my data access class is static and I have added a parameterless constructor
to my dataObjectType class (though I still call the parameterd one in
itemInserting event).

note: I placed breakpoints in parameterless constructor and datasource's
objectCreating event; the error comes before the breakpoints are even reached.
 
E

elburze

I am using a gridview [only to view(select)] and a formview [to insert]
some data. My gridview displays information correctly, but clicking on insert
button for the formview gives me error: "No parameterless constructor defined
for this object".

Data are persisted in a hiddentextbox as Xml and are used to create a
globally declared Dataset on page_load(). I have a dataObjectType class
"DataSetWrapper" and a static data access class "TendersDataSetAccessMethods"
[ofcurse, methods have parameter of type "DataSetWrapper"].

I add the insert parameter on formview's itemInserting event
(objdataSource's Inserting event seems to be too late).
can someone tell me please which object has no parameterless constructor?!!
my data access class is static and I have added a parameterless constructor
to my dataObjectType class (though I still call the parameterd one in
itemInserting event).

note: I placed breakpoints in parameterless constructor and datasource's
objectCreating event; the error comes before the breakpoints are even reached.
 
E

elburze

or if there is a way to stop the debugger on the .net method the error
happens in and use watch to look at local variables and find out what it is
talking about !!
 
M

Moustafa Gaber

  I am using a gridview [only to view(select)] and a formview [to insert]
some data. My gridview displays information correctly, but clicking on insert
button for the formview gives me error: "No parameterless constructor defined
for this object".

Data are persisted in a hiddentextbox as Xml and are used to create a
globally declared Dataset on page_load(). I have a dataObjectType class
"DataSetWrapper" and a static data access class "TendersDataSetAccessMethods"
[ofcurse, methods have parameter of type "DataSetWrapper"].

I add the insert parameter on formview's itemInserting event
(objdataSource's Inserting event seems to be too late).
can someone tell me please which object has no parameterless constructor?!!
my data access class is static and I have added a parameterless constructor
to my dataObjectType class (though I still call the parameterd one in
itemInserting event).

note: I placed breakpoints in parameterless constructor and datasource's
objectCreating event; the error comes before the breakpoints are even reached.

Hello,

I think the problem is in serialization of an object into XML.
The object that is supposed to be serialized should have 2
Constructors:
- Default Constructor with no parameters. As when the
deserialization process starts, it would create an instanse of that
object with no paramters, then set the
attributes in that object by Properties on the attributes.
- The other constructor is as you would like it to be.

I hope I could answer and show it clearly.
 

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