Hi,
I have a database containing the concept of an Item, which may be
associated with zero, one, or many project. It is stored in a
normalized database via three tables as shown at the end of this email. Is
there a way with the grid view classes to display a list of items with
their corresponding projects completely horizontally, in other words
either:
Item Name | Projects |
---------------------------
Item1 | P1, P2 |
Item2 | P1, P3, P4, P5 |
Or possibly:
Item Name | Project A | Project B | ... | Project xyz |
--------------------------------------------------------
Item 1 | P1 | P2 | | |
Item 2 | P1 | P2 | ... | P5 |
Client platform is C# web app in visual studio 2005. To do this on the SQL
side would require either cursors or denormalizing the database which are
both bad things. Here is a sample DDL:
Create Table Item (
ItemID int identity primary key,
Name varchar(64)
)
Create Table Project (
ProjectID int identity primary key,
Name varchar(64)
)
Create Table ItemProjectLink (
ItemID int,
ProjectID int,
primary key (ItemID, ProjectID)
foreign key (ItemID) references Item,
foreign key (ProjectID) references Project
)
TIA,
Dave