Home
Help
Register
Log in

Search

 
   Active Threads  

You are here: Home > LLBLGen Pro > LLBLGen Pro Runtime Framework> how to use Logical relation with IRelationCollection ( but physically doesnt exist)
 

Pages: 1
LLBLGen Pro Runtime Framework
how to use Logical relation with IRelationCollection ( but physically doesnt exist)
Page:1/1 

  Print all messages in this thread  
Poster Message
sekorev
User



Location:

Joined on:
16-May-2008 12:28:03
Posted:
11 posts
# Posted on: 16-May-2008 12:41:15.  
Hi,

I have some problems with "Relation" issue.

Lets say that I have 2 db tables named Description , Users
Description has 4 columns named :id, userid, source_type, source_id
Users has 2 columns named : id, name

Logically Description.userid refers to Users.id but physically there is no relation within database.
What i cant do is adding a relation using RelationCollection and bind to datagrid.

My code is as follows

DescriptionsCollection dc = new DescriptionsCollection();
        PredicateExpression filter = new PredicateExpression();
        filter.Add(DescriptionsFields.SourceId == _id);
        filter.Add(DescriptionsFields.SourceType == _type);
        SortExpression sort = new SortExpression(DescriptionsFields.InsertDate | SortOperator.Descending);
        //IRelationCollection relations = new RelationCollection();
        //relations.Add(UsersEntity.Relations.);
        dc.GetMulti(filter,0,sort);
        gv.DataSource = dc;
        gv.DataBind();

note: there is no relation/attribute under UsersEntity.Relations.
  Top
arschr
User



Location:
Atlanta, Georgia; USA
Joined on:
14-Dec-2003 16:57:29
Posted:
881 posts
# Posted on: 16-May-2008 15:05:42.  
In the designer you should be able to manually add this relation as long as the datatypes are the same and id is the primary key of the user table. (Assuming it is 1 user to many descriptions).

- Al  Top
sekorev
User



Location:

Joined on:
16-May-2008 12:28:03
Posted:
11 posts
# Posted on: 16-May-2008 15:15:43.  
Hi,

I am still figuring it out. thanks for the help.
  Top
Pages: 1  


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

Version: 2.1.12172008 Final.