Using related table adapters

G

gilbes

I have been searching for a solution to this for a while now and
everything I have found has lead me down the wrong path. Any
assistance you guys could give would be much appreciated.

I would like to bind a control to an object data source control and
get data from related tables.

For example:
Categories (table)
-CategoryID
-CategoryName

Items (table)
-ItemID
-CategoryID
-ItemName

The tables are a one-many from Categories to Items on CategoryID.
My application is ASP.Net (vb.net) 2.0 using table adapters for a data
access layer and classes in a business logic layer. The DAL has a
relationship for the 2 tables.
On this page I would like to display a checkbox list of each item,
grouped together by category name. Category name will be displayed
above the group of items it describes.

I am trying to adapt the approach from this article (which is not
using table adapters):
http://msdn2.microsoft.com/en-us/library/aa478959.aspx

I have bound the top level repeater to a BLL class that returns the
Categories table and fills the Items table. At run-time the items
table is not associated as a child of the Categories table, so I
cannot access it through the object data source.

I am not married to this approach and would appreciate it if anyone
could steer me in the right direction. However, I want to avoid
joining the tables first and working with them that way. I already do
that in areas where it is very appropriate. I can see a lot of
benefits to being able to work with multiple related tables separately
in the BLL and the presentation layer without joining them first.


Thanks!
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top