ObjectDataSource Update method and StronglyTyped data tables

Discussion in 'ASP .Net' started by Max2006, Oct 23, 2007.

  1. Max2006

    Max2006 Guest

    Hi,

    I am truing to find a pattern for my Business Logic Layer to be able to work
    fine win ObjectDataSource's Update method.


    The challenge is ObjectDataSource is not able to work with an update method
    that accepts a strongly typed data table as parameters. We have to have an
    update method with all data table's columns as its parameter. Like what we
    have here: http://asp.net/learn/data-access/tutorial-16-cs.aspx

    I am trying to avoid listing all columns as Update method's parameters. Is
    there any way to use the actual strongly type data table as the parameter
    for ObjectDataSource's update method?

    Any help would be appreciated,
    Max
     
    Max2006, Oct 23, 2007
    #1
    1. Advertising

  2. Hi Max,

    Regarding on the ASP.NET ObjectDataSource and the update method, it will
    always require the following parameters pattern:

    ** a parameter list which represent all the necessary fields of a data
    record(or a custom object)

    ** a custom class instance(whose properties can be mapping to database
    record fields)

    This reason why ObjectDataSource limit this is that DataSource control is
    designed to work together with those complex databound controls, and for
    those controls(such as GridView, DataGrid, DataList), its updating model is
    one-record(row) per updating time(not batch updating). If you use DataTable
    as parameter, that means you want to do batch update which doesn't match
    those template databound control's update model. For such scenario, I
    think it would be more flexible that you write the udpating code logic your
    self so as to batch update multiple records.

    Sincerely,

    Steven Cheng

    Microsoft MSDN Online Support Lead



    ==================================================

    Get notification to my posts through email? Please refer to
    http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
    ications.



    Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
    where an initial response from the community or a Microsoft Support
    Engineer within 1 business day is acceptable. Please note that each follow
    up response may take approximately 2 business days as the support
    professional working with you may need further investigation to reach the
    most efficient resolution. The offering is not appropriate for situations
    that require urgent, real-time or phone-based interactions or complex
    project analysis and dump analysis issues. Issues of this nature are best
    handled working with a dedicated Microsoft Support Engineer by contacting
    Microsoft Customer Support Services (CSS) at
    http://msdn.microsoft.com/subscriptions/support/default.aspx.

    ==================================================


    This posting is provided "AS IS" with no warranties, and confers no rights.
    --------------------
    >From: "Max2006" <>
    >Subject: ObjectDataSource Update method and StronglyTyped data tables
    >Date: Tue, 23 Oct 2007 18:09:08 -0400


    >
    >Hi,
    >
    >I am truing to find a pattern for my Business Logic Layer to be able to

    work
    >fine win ObjectDataSource's Update method.
    >
    >
    >The challenge is ObjectDataSource is not able to work with an update

    method
    >that accepts a strongly typed data table as parameters. We have to have an
    >update method with all data table's columns as its parameter. Like what we
    >have here: http://asp.net/learn/data-access/tutorial-16-cs.aspx
    >
    >I am trying to avoid listing all columns as Update method's parameters. Is
    >there any way to use the actual strongly type data table as the parameter
    >for ObjectDataSource's update method?
    >
    >Any help would be appreciated,
    >Max
    >
    >
    >
     
    Steven Cheng[MSFT], Oct 25, 2007
    #2
    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. Felix_WafyTech
    Replies:
    1
    Views:
    3,349
    Steven Cheng[MSFT]
    Feb 28, 2006
  2. S.Tedeschi

    StronglyTyped DataSets in ASP.NET 2.0

    S.Tedeschi, Jun 7, 2007, in forum: ASP .Net
    Replies:
    2
    Views:
    283
    Peter Bradley
    Jun 7, 2007
  3. Aamir Ghanchi

    Formview and ObjectDataSource Update method

    Aamir Ghanchi, Jan 7, 2008, in forum: ASP .Net
    Replies:
    3
    Views:
    1,202
    Phil H
    Feb 5, 2008
  4. rote
    Replies:
    0
    Views:
    332
  5. David Thielen

    ObjectDataSource method as another ObjectDataSource

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

Share This Page