Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 2.0 and Databases
This is the forum to discuss the Wrox book Beginning ASP.NET 2.0 and Databases by John Kauffman, Bradley Millington; ISBN: 9780471781349
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 2.0 and Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 26th, 2009, 03:57 PM
Authorized User
 
Join Date: Apr 2008
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to AspNetGuy
Default GridView With ObjectDataSource

Hi,

I have a GridView that uses an ObjectDataSource. The objects being displayed are Inquiry objects. In the Inquiry object I have a reference to a Person object. In the Person class I have two properties of interest; FirstName and LastName.

When configuring the GridView the reference to the Person object is visible in the list properties, however the properties in the Person object are not. That is because the object linked to by the datasource is the Inquiry object not the Person object.

So in order to display in the GridView the first and last names of the person who submitted the inuiry I am thinking of adding two properties to the Inquiry object; FirstName and LastName. I do not intend to duplicate the data in the Inquiry object, but rather have the two properties in the Inquiry object pull the first name and last name from the Person object referenced in the Inquiry object.


Is this the proper way to do this in an OO fashion or am I missing something?

Thanks in advance for any help.
 
Old April 26th, 2009, 10:35 PM
Friend of Wrox
 
Join Date: May 2005
Posts: 227
Thanks: 1
Thanked 7 Times in 7 Posts
Default GridView With ObjectDataSource

AspNetGuy:
I think you are on the right track. Verifiy in your Datasource, which is or should be relational especially if you are using a related table as in your Inquiry Object (table) using the PersonObject Primary Key (PersonID) in order to displary the information from the Person table. Verify the relationship(s) among your Table Objects as in an E-R Diagram based on the DataSource.

Hope This Helps.
__________________
Disclaimer: The above comments are solely the opinion of one person and not to be construed as a directive or an incentive to commit fraudulent acts.
 
Old April 26th, 2009, 11:52 PM
Authorized User
 
Join Date: Apr 2008
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to AspNetGuy
Default Thanks For Your Input

Thanks for your input.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Binding GridView to ObjectDataSource which... rsearing ASP.NET 2.0 Professional 15 July 9th, 2008 01:44 AM
ObjectDataSource in UserControl Colonel Angus .NET Framework 2.0 0 April 3rd, 2008 10:14 AM
CH5 ObjectDataSource nabeelalkaff BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 0 March 8th, 2007 01:19 PM
Chapter5 ObjectDataSource nabeelalkaff BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 2 March 5th, 2007 01:15 AM
Problem with ObjectDataSource... veeruu ASP.NET 2.0 Professional 0 March 2nd, 2007 07:45 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.