formview, objectdatasource, update method

K

kidders

I have an business object bound to a formview with through an object
datasource, in edit mode when i click update i receive the following
error:

The 'ActionID' property on the type specified by the DataObjectTypeName
property in ObjectDataSource 'odsAction' is readonly and its value
cannot be set.

This is correct as the actionid property is readonly (being the primary
key).

I've been trying to find out how to tell the objectdatasource that this
is readonly, im not reading the actionid out to the form as its not
required to be viewable.

I tried putting <DataObjectFieldAttribute(True, True, False)> before
the property as suggested in another thread like so:

''' <summary>
''' Property to get the id of the event
''' </summary>
''' <value></value>
''' <returns>The event id</returns>
''' <remarks>DataObjectFieldAttribute is added to let the
objectdatasource control know
''' that this property is the primary key and as such,
readonly</remarks>
<DataObjectFieldAttribute(True, True, False)> _
ReadOnly Property ActionID() As Integer
Get
Return _autoBean.GetValue("ActionID")
End Get
End Property

This has made no difference though, i still receive the above error.

Any ideas on how to stop it from tryign to update the actionid?

Cheers,

kidders
 

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

Members online

Forum statistics

Threads
473,968
Messages
2,570,154
Members
46,701
Latest member
XavierQ83

Latest Threads

Top