How to retrive a reference to actual obj in ObjectDataSource?

  • Thread starter Victor Reboucas
  • Start date
V

Victor Reboucas

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
 
M

Manu

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
 
R

Relaxin

Manu said:
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.
 

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,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top