formview, objectdatasource, update method

Discussion in 'ASP .Net' started by kidders, Jan 23, 2007.

  1. kidders

    kidders Guest

    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
    kidders, Jan 23, 2007
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?RGFiYmxlcg==?=

    FormView update not updating with ObjectDataSource

    =?Utf-8?B?RGFiYmxlcg==?=, Apr 13, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    9,304
    =?Utf-8?B?RGFiYmxlcg==?=
    Apr 13, 2006
  2. Fred Dag
    Replies:
    0
    Views:
    1,679
    Fred Dag
    Sep 18, 2006
  3. Afshar
    Replies:
    0
    Views:
    348
    Afshar
    Apr 24, 2007
  4. Aamir Ghanchi

    Formview and ObjectDataSource Update method

    Aamir Ghanchi, Jan 7, 2008, in forum: ASP .Net
    Replies:
    3
    Views:
    1,186
    Phil H
    Feb 5, 2008
  5. David Thielen

    ObjectDataSource method as another ObjectDataSource

    David Thielen, Mar 21, 2006, in forum: ASP .Net Web Controls
    Replies:
    3
    Views:
    242
    Steven Cheng[MSFT]
    Mar 23, 2006
Loading...

Share This Page