N-Tier Object datasource and Gridview

Discussion in 'ASP .Net' started by =?Utf-8?B?TGFycnkgQ2hhcmx0b24=?=, May 22, 2006.

  1. I seem to be having a mental block for some reason.

    Some goals:
    A web form with fields
    A web service that processes those fields
    Send the fields as a single parameter to the web service
    Use an object datasource to populate the form
    Object datasources get values from properties in classes

    How do I structure a class so that I can marshal data in a web app (from the
    screen) and in a web service (from the database) while still allowing it to
    be bound to a datagridview or formview and be sent as a marshalled unit
    accross the wire? (i.e. I don't want to invoke the web service to set each
    property)

    Or do I just have to manually create tables and not use data binding?

    What's comming to mind is using a class/structure with public members and
    then writing code to move it in and out of another class with properties?
    Ouch.
    =?Utf-8?B?TGFycnkgQ2hhcmx0b24=?=, May 22, 2006
    #1
    1. Advertising

  2. =?Utf-8?B?TGFycnkgQ2hhcmx0b24=?=

    olrt Guest

    Classic architectural design :

    Let's say that you designed a typed DataSet : MyDataSet
    You bind your Webform controls to an instance of MyDataSet (in fact
    there's a middle object between controls and Data that is called
    DataBind).

    Your Webservice should have two methods :
    FillDataSet(MyDataSet ds)
    UpdateDataSet(MyDataSet ds)

    Your ASP.NET application should call FillDataSet to obtain data, and
    call UpdateDataSet to update data.

    So the architecture is :

    Web form <--Serialized DataSet--> Web service <--SQL--> Database
    olrt, May 22, 2006
    #2
    1. Advertising

  3. I found the following:

    If I create a class that has properties in a web service and in another
    class that has web methods, return the first class. My application when it
    gets a reference to the webservice will also get a reference to the class (I
    assume with no functionality). I can then send and retrieve this class and
    getting/setting individual properties are not sent accross the wire.

    Larry
    =?Utf-8?B?TGFycnkgQ2hhcmx0b24=?=, May 22, 2006
    #3
  4. =?Utf-8?B?TGFycnkgQ2hhcmx0b24=?=

    olrt Guest

    You are talking about "serialization" of objects.
    You can mark serializable properties with the metadata [Serializable].
    olrt, May 22, 2006
    #4
    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. rob

    ASP v2 & 3-tier or 2-tier

    rob, Aug 13, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    406
    Steve C. Orr [MVP, MCSD]
    Aug 13, 2004
  2. NOSPAM

    2 tier to 3 tier?

    NOSPAM, Oct 14, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    426
    =?Utf-8?B?Q293Ym95IChHcmVnb3J5IEEuIEJlYW1lcikgLSBN
    Oct 14, 2004
  3. Steve Kershaw

    Setting up a new tier in a 3-tier system?

    Steve Kershaw, Mar 28, 2006, in forum: ASP .Net
    Replies:
    3
    Views:
    444
    Steve Kershaw
    Mar 29, 2006
  4. Shantanu Bhattacharya
    Replies:
    2
    Views:
    548
    Christopher Benson-Manica
    Dec 26, 2003
  5. Shantanu Bhattacharya

    Converting a 2-tier application to 3-tier application

    Shantanu Bhattacharya, Dec 25, 2003, in forum: C Programming
    Replies:
    2
    Views:
    455
    Christopher Benson-Manica
    Dec 26, 2003
Loading...

Share This Page