How to retrive a reference to actual obj in ObjectDataSource?

Discussion in 'ASP .Net Datagrid Control' started by Victor Reboucas, Apr 9, 2007.

  1. Hi, I have lots of data layer objects and want to use them in an
    ObjectDataSource object to bind it's results to a GridView.

    The problem is that all these data layer objects are (let's say)
    "connectionless", that is, the connection they use is assigned by an upper
    level business object.

    All I need is a way to reference the real object being used by the
    ObjectDataSource control to set it's connection.


    thanks for any clue
    regards
    Victor
    Victor Reboucas, Apr 9, 2007
    #1
    1. Advertising

  2. Victor Reboucas

    Manu Guest

    Hi,

    I'm not sure if I have understood your requeriments, but you can
    access to the instance of type TypeName created by the
    ObjectDataSource handling the ObjectCreated event and using the
    ObjectInstance property of the event args.

    If that is not what you want, please explain it better.

    Regards,
    Manuel Abadia
    http://www.manuelabadia.com

    On Apr 9, 1:11 am, "Victor Reboucas" <> wrote:
    > Hi, I have lots of data layer objects and want to use them in anObjectDataSourceobject to bind it's results to a GridView.
    >
    > The problem is that all these data layer objects are (let's say)
    > "connectionless", that is, the connection they use is assigned by an upper
    > level business object.
    >
    > All I need is a way to reference the real object being used by theObjectDataSourcecontrol to set it's connection.
    >
    > thanks for any clue
    > regards
    > Victor
    Manu, Apr 10, 2007
    #2
    1. Advertising

  3. Victor Reboucas

    Relaxin Guest

    "Manu" <> wrote in message
    news:...
    > Hi,
    >
    > I'm not sure if I have understood your requeriments, but you can
    > access to the instance of type TypeName created by the
    > ObjectDataSource handling the ObjectCreated event and using the
    > ObjectInstance property of the event args.
    >

    But what is so odd about it is this statement from the help:

    "If the method that is identified to perform the data operation is static
    (Shared in Visual Basic), the ObjectCreating and ObjectCreated events are
    never raised."

    Even if it IS a static method it should still raise the ObjectCreated event
    because you still can't get a reference to the instance that the
    ObjectDataSource is using.
    Relaxin, Apr 16, 2007
    #3
    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. Mark Kamoski
    Replies:
    3
    Views:
    15,631
    Jay B. Harlow [MVP - Outlook]
    Aug 9, 2003
  2. Phil Endecott

    Obj* ptr = new Obj(X)

    Phil Endecott, Jun 3, 2005, in forum: C++
    Replies:
    5
    Views:
    449
    Mark P
    Jun 3, 2005
  3. Shalabh Chaturvedi
    Replies:
    2
    Views:
    428
    Mike C. Fletcher
    Feb 20, 2004
  4. Matthew Thorley

    How do you convert a string obj to a file obj?

    Matthew Thorley, May 4, 2005, in forum: Python
    Replies:
    7
    Views:
    483
    Peter Otten
    May 4, 2005
  5. alf
    Replies:
    9
    Views:
    388
Loading...

Share This Page