Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / ADO.NET / April 2006

Tip: Looking for answers? Try searching our database.

Access ObjectDataSource data from asp.net codebehind

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jeronimo Bertran - 04 Apr 2006 03:25 GMT
Hello,

I have a web page that uses two ObjectDataSource controls to bind data to a
FormView and a grid .

In my grid which is bound to ObjectDataSource2, I want to add in the footer
information from certain fields from the first ObjectDataSource.  I am
using the DataBound event to add data to the footer but I can't find a way
to access the underlying tables of the ObjectDataSource.

Thanks.

Jeronimo
Kevin Yu [MSFT] - 04 Apr 2006 08:09 GMT
Hi Jeronimo,

The ObjectDataSource creates data source at runtime. You can get the object
instance in the ObjectDataSource.ObjectCreated event. In the
ObjectDataSourceEventArgs, the ObjectInstance property is the reference to
the created data source object.

HTH.

Kevin Yu
Signature

=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Jeronimo Bertran - 04 Apr 2006 18:08 GMT
Hi Kevin,

Thanks for the post.   The ObjectInstance as you mentioned returned de data
source object.  But how can I access the underlying dataset that was
populated through the object's select statement?

Thanks again,

Jeronimo
Kevin Yu [MSFT] - 05 Apr 2006 04:15 GMT
Hi Jeronimo,

To access the DataSet that populates the objects, you need to write extra
code in the object class. For example, you can put a property in the class,
so when we get that object, we can get the DataSet from the property. HTH.

Kevin Yu
Signature

=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Jeronimo Bertran - 05 Apr 2006 23:20 GMT
ok   Thanks
Kevin Yu [MSFT] - 06 Apr 2006 06:56 GMT
You're welcome.

Kevin Yu
Signature

=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.