DataBindingSource and Prefetch?

Posts   
 
    
Rushmore
User
Posts: 125
Joined: 27-Jan-2005
# Posted on: 23-Apr-2008 11:42:38   

Hi,

is it possible at design-time to use a prefetch path for databinding in adapter scenario? Or do I have to build a TypedList?

For example:

CustomerEntity AddressEntity

The GridView should display Customer.Number, Customer.Address.Name etc.

The details should display something like this:

Textbox1.Text = Customer.Number Textbox2.Text = Customer.Address.Name

I need helpful suggetions please simple_smile

Kindly regards, Carlo

Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 23-Apr-2008 12:31:05   

1- If the Grid will be read only, use a TypedList or a DynamicList.

2- If not, then use prefetchPaths in the fetch method to fetch related entities as well, this will issue one database call for example to fetch all customers for all orders, and hence will disable LazyLoading (in case of SelfServicing).

3- You can specify excludedIncludedFields list to execlude fields from being fetched. this is also true in the prefetched related entities.

I guess the ASP.NET 2.0 databinding example, in the v.2.5 download section has many useful examples.

Rushmore
User
Posts: 125
Joined: 27-Jan-2005
# Posted on: 23-Apr-2008 13:54:37   

Walaa wrote:

2- If not, then use prefetchPaths in the fetch method to fetch related entities as well, this will issue one database call for example to fetch all customers for all orders, and hence will disable LazyLoading (in case of SelfServicing).

Ok, but I want to bind some fields (ex. Customer.Address.Name) @ Design-Time. The problem is that only the fields from the root entity are selectable. Maybe that issue is related to the cardinality of the relation?

At runtime the prefetchpath works as expected.

Regards, Carlo

Rushmore
User
Posts: 125
Joined: 27-Jan-2005
# Posted on: 23-Apr-2008 14:20:26   

Walaa wrote:

2- If not, then use prefetchPaths in the fetch method to fetch related entities as well, this will issue one database call for example to fetch all customers for all orders, and hence will disable LazyLoading (in case of SelfServicing).

Ok, but I want to bind some fields (ex. Customer.Address.Name) @ Design-Time. The problem is that only the fields from the root entity are selectable. Maybe that issue is related to the cardinality of the relation?

At runtime the prefetchpath works as expected.

Regards, Carlo

Walaa avatar
Walaa
Support Team
Posts: 14950
Joined: 21-Aug-2005
# Posted on: 23-Apr-2008 15:33:18   

Ok, but I want to bind some fields (ex. Customer.Address.Name) @ Design-Time. The problem is that only the fields from the root entity are selectable. Maybe that issue is related to the cardinality of the relation?

Currently not supported, similar discussion was held here: http://www.llblgen.com/TinyForum/Messages.aspx?ThreadID=13130