Current Record

Posts   
 
    
eugene
User
Posts: 85
Joined: 05-Oct-2004
# Posted on: 14-Dec-2004 15:46:15   

Hi there,

I am using Adapter with vb.net. I use an EntityCollection with a factory that I specify at design time. On the form I am only using single controls to fill with data from the EntityCollection (which works perfectly with prefetchpath and Grids to display child-relationships of the parent entity sunglasses ). I need to navigate (next, previous, first or last) through the collection and to determine the current record for further data operations. How is this possible? The EntityCollection does not expose a Current or a Position member that I can see.

Any help will be appreciated!!!

Best regards

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 14-Dec-2004 15:57:23   

'current record' is a concept that is only known at runtime and you can determine that from the grid or from the currencymanager of the form.

Frans Bouma | Lead developer LLBLGen Pro
eugene
User
Posts: 85
Joined: 05-Oct-2004
# Posted on: 14-Dec-2004 16:34:43   

I've got it now!! Thank you for the reply. I still have one problem to deal with:

At the moment I use the design-time collection as a parameter in call to a routine that fetches the data and this works fine. When I use a function that returns a filled EntityCollection, how can I transfer the data from the returned collection to the design-time object?

Best regards

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 14-Dec-2004 16:58:01   

the object you drag onto a form is a private member variable of the form, so you can work with that as if you specified the member variable yourself.

Frans Bouma | Lead developer LLBLGen Pro
eugene
User
Posts: 85
Joined: 05-Oct-2004
# Posted on: 14-Dec-2004 17:05:12   

Dear Otis,

I guess my question wasn't well-formulated.

The BL facade has two methods:

Function GetData() As Entitycollection Sub GetData(col As EntityCollection)

In my form I have my designtime-defined EntityCollection, DataCol. If I use the Sub (handing the locally defined member as a paramter) the EntityCollection is filled and the DataBindig works as designed. If I use the function (receiving an EntityCollection with the same EntityFactory and the same data), and then set the locally defined member to the one received from the function-call, the DataBinding doesn't work (or at least I would have to wire each Control on the form).

My question is: is it possible to call the function, receive the data, and then hand this data over to the locally defined EntityCollection?

Best regards

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 14-Dec-2004 17:30:17   

No that's not possible, as the form's databinding is setup by the InitialiseComponent method in the form, which contains code generated by vs.net. So unless you pass on the form's DataCol object, which is already wired up to the controls, you have to re-wire the object to the controls.

You could of course check what code vs.net generates, the copy/paste that code and refactor it a bit to a method you have to call to wire an entity collection to all the controls simple_smile

Frans Bouma | Lead developer LLBLGen Pro
eugene
User
Posts: 85
Joined: 05-Oct-2004
# Posted on: 15-Dec-2004 09:24:51   

Dear Otis,

Thank you for your reply!

We are planning on using remoting (binary). I believe that handing objects that go beyond the .NET types, across remoting boundries requires FullTrust (maybe a security issue), more band-width, and memory (complex serialization at both endpoints).

How much do these issues weigh in your experience? Are there any other issues that speak against handing the wired objects across the remoting boundires?

Best regards

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39933
Joined: 17-Aug-2003
# Posted on: 15-Dec-2004 13:25:11   

I think they can be an issue, as with everything that's related to the data transported in a distributed environment. One of the key aspects of a scalable distributed application is that you have to pass as less data over teh wire as possible and you should limit the client-server 'chatter'.

Frans Bouma | Lead developer LLBLGen Pro