prefetchPath

Posts   
 
    
shekar
User
Posts: 327
Joined: 26-Mar-2010
# Posted on: 14-Jun-2012 09:41:15   

LLBLGEN 3.5 SQL Server 2005 .net framework 4.0 C# windows application LLBLGen Runtime framework

I have tables 1. State and 2. Country

State has a FK column countryid related to table country. Now in the following code, I need to check both state.flag=0 and country.flag=0 based on the FK value in state. How can i do that

dgridsearchstate.ReadOnly = true;
                var prefetchPath = new PrefetchPath(EntityType.StateEntity);
                prefetchPath.Add(StateEntity.PrefetchPathCountry);
                _filter = new PredicateExpression(StateFields.Flag == Flag.Validflag);
                ISortExpression sorter =
                    new SortExpression(StateFields.Description | SortOperator.Ascending);
                _state.GetMulti(_filter, prefetchPath);
                _state.DefaultView.Sorter = sorter;
                dgridsearchstate.DataSource = _state;
Walaa avatar
Walaa
Support Team
Posts: 14994
Joined: 21-Aug-2005
# Posted on: 14-Jun-2012 19:27:19   

Please explain what do you need to fetch in the first place. Also if you can put it in SQL syntax it would be much easier.

shekar
User
Posts: 327
Joined: 26-Mar-2010
# Posted on: 15-Jun-2012 06:36:48   

Walaa wrote:

Please explain what do you need to fetch in the first place. Also if you can put it in SQL syntax it would be much easier.

I meant Select s.descrption, c.description from state s, country c where s.countryid=c.countryid and s.flag=0 and c.flag=0

Walaa avatar
Walaa
Support Team
Posts: 14994
Joined: 21-Aug-2005
# Posted on: 15-Jun-2012 10:19:07   

You need to use a Dynamic List

shekar
User
Posts: 327
Joined: 26-Mar-2010
# Posted on: 15-Jun-2012 10:20:44   

Walaa wrote:

You need to use a Dynamic List

Thank you