CustomerFields.Country

Posts   
 
    
Posts: 6
Joined: 30-Apr-2007
# Posted on: 30-Apr-2007 19:00:31   

Sorry for a stupid post - I have a couple questions. I'm just getting started and have seen the use of predicates in examples, but where is the "CustomerFields" object defined? Is this something I have to create myself as an enum or something? Here is an example I grabbed from here:

        Dim da As New DataAccessAdapter
        Dim customers As EntityCollection
        Dim bucket As New RelationPredicateBucket()
        Dim sortOrder As New SortExpression 

        customers = New EntityCollection(New CustomerEntityFactory)
        bucket.PredicateExpression.Add(CustomerFields.Country = "France")
        sortOrder = (CustomerFields.CompanyName Or SortOperator.Ascending)

        da.FetchEntityCollection(customers, bucket, 0, sortOrder)

Also, I haven't found anywhere that I can trace to, in order to actually see the SQL being generated and run - is this accessible, or hidden within a dll or something

Lastly, I have an entity collection bound to a DataGridView, is there a way to directly reference the object that corresponds to a row (possibly through the currency manager) or do I just need to get a unique ID from the row and load using that (thats what I'm currently doing)

Thanks for any help!

Posts: 6
Joined: 30-Apr-2007
# Posted on: 30-Apr-2007 21:27:22   

I figured out the CustomerFields thing, it was located within the HelperClasses. Anyone that can help with the other questions can still answer them!

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 01-May-2007 07:43:05   

Hi, If you are using WinForms (I suspect that) you could achieve that in both BindingSource and GridView ways simple_smile :

CustomersEntity customerFromBS =  (CustomersEntity) this.customersEntityBindingSource.Current;

CustomersEntity customerFromGV = (CustomersEntity) this.customersEntityDataGridView.Rows[0].DataBoundItem;

For more info please review the LLBLGenPro Help - Using generated code - (Adpater | SS) - Databinding. Also at http://www.llblgen.com/pages/examples.aspx review the Databinding examples. wink

Regards

David Elizondo | LLBLGen Support Team