Home
Help
Register
Log in

Search

 
   Active Threads  

You are here: Home > LLBLGen Pro > Architecture> Lookups and the way to go
 

Pages: 1
Architecture
Lookups and the way to go
Page:1/1 

  Print all messages in this thread  
Poster Message
davisg
User



Location:
Bradford, UK
Joined on:
27-Feb-2005 16:18:43
Posted:
113 posts
# Posted on: 31-Mar-2005 11:31:39.  
Hi All,

I have tried to look for this info in the forums and i'm sure it is there but I can't find it.

I have a table called Artist and the Artist has a relationship with ArtistRelated. Both tables are displayed below:

Artist
====

ArtistID PK int
Name string

ArtistRelated
=========

ArtistID PK int
RelatedID PK int

The RelatedID is an ArtistID in the table Artist, self referencing as so to speak.

In my form I read the entity like below and set the datagrid to it's relationship like so:

ArtistEntity artist = new ArtistEntity(477707);
gridControl1.DataSource = artist.GetMultiArtistRelationship(true);

Now this works great and I get my grid filled with ArtistID and RelatedID like so:

ArtistID RelatedID
477707 583483
477707 383834
477707 383894

What I want to do is fill my grid with the Artist Name associated with the RelatedID. Do I have to do through the collection one at a time and read the entity Artist for the Name; if so how does do I do that? or is there a better way?

A code snippet would be great if possible as I will be doing this a lot. Wink

Thanks in advance.

Geoff.
Before software can be reusable it first has to be usable!  Top
Mountain
User



Location:
Florida
Joined on:
01-Apr-2005 05:05:51
Posted:
21 posts
# Posted on: 01-Apr-2005 20:03:54.  
davisg wrote:
Hi All,

I have tried to look for this info in the forums and i'm sure it is there but I can't find it.

I have a table called Artist and the Artist has a relationship with ArtistRelated. Both tables are displayed below:

Artist
====

ArtistID PK int
Name string

ArtistRelated
=========

ArtistID PK int
RelatedID PK int

The RelatedID is an ArtistID in the table Artist, self referencing as so to speak.

In my form I read the entity like below and set the datagrid to it's relationship like so:

ArtistEntity artist = new ArtistEntity(477707);
gridControl1.DataSource = artist.GetMultiArtistRelationship(true);

Now this works great and I get my grid filled with ArtistID and RelatedID like so:

ArtistID RelatedID
477707 583483
477707 383834
477707 383894

What I want to do is fill my grid with the Artist Name associated with the RelatedID. Do I have to do through the collection one at a time and read the entity Artist for the Name; if so how does do I do that? or is there a better way?

A code snippet would be great if possible as I will be doing this a lot. Wink

Thanks in advance.

Geoff.


I just posted a similar question. Here's the reply I received:

M:n relations with self are currently not supported (in 1.0.2004.1). If you want I can switch it on in 1.0.2004.2. It was disabled because the runtime engine couldn't alias in the past (before 1.0.2004.1, which wasn't a gui update).

Though as with all relations with self, as you're working on the same table, queries could be more optimial if you simply specify the filters yourself.

My post is here: http://www.llblgen.com/tinyforum/Messages.aspx?ThreadID=2709



  Top
Pages: 1  


Powered by HnD ©2002-2007 Solutions Design
HnD uses LLBLGen Pro

Version: 2.1.12172008 Final.