Equivalent of VFP SET RELATION TO


Author
Message
Larry Tucker
Larry Tucker
StrataFrame User (173 reputation)StrataFrame User (173 reputation)StrataFrame User (173 reputation)StrataFrame User (173 reputation)StrataFrame User (173 reputation)StrataFrame User (173 reputation)StrataFrame User (173 reputation)StrataFrame User (173 reputation)StrataFrame User (173 reputation)
Group: StrataFrame Users
Posts: 69, Visits: 308
I'm coming to Strataframe and .NET from Visual Foxpro and would like to set two relations for a child BO: one to the child's actual parent, and one to a lookup table for a given foreign key field on the child, something like:

OrderBO.Cust_id -> CustomerBO.Cust_id

and

OrderBO.Prod_id ->ProductBO.Prod_id

As I navigate through each Order record, I want to be able to display the related Customer.Name and Product.Title.

I've been able to successfully set the OrderBO.ParentBusinessObject = "CustomerBO" in the property sheet, but do not know how to set another relation at the same time or how to do this in code.  Any help would be much appreciated.

TIA,

Larry

Reply
Trent Taylor
Trent Taylor
StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)StrataFrame Developer (14K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 7K
I would tend to agree with Peter on the lookups.  We have hundreds of places that a foreign key value needs to be selected or set.  For example, we may have a patient and their preferred pharmacy may need to be selected.  So we may populate a combo box with only the values that need to be used and bind it to the patients foreign key field.  It is always good to create a custom Fill method that only brings back the required fields in this case...no reason to add overhead:

Public Sub FillForComboDisplay()
   '-- Establish Locals
    Dim cmd As New SqlCommand("SELECT ph_pk, ph_Name FROM Pharmacies ORDER BY ph_Name")
    Me.FillDataTable(cmd)
End SUb

I would then use the FillForComboDisplay as the method to populate the combo...and the ph_pk would be the Value Member which is bound to the foreign key field.

BTW, Peter, thanks for your nice words regarding our support! 

As you may have noticed, we have a wrapper for both DevExpress and Infragistics.  Ultimately we use some of the Infragistics (after first using DevExpress) controls in our medical software.  But we have create custom controls and continue to extend our StrataFrame controls due to one isolated issue or another.  DevExpress and Infragistics are both good control companies, but we predominately use the SF controls except in areas like the UltraGrid or controls of that nature.  Infragistics also has some good masking controls (i.e. currency) but they still take some tweaking to get it just right.

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View
Threaded View
Larry Tucker - 17 Years Ago
Ivan George Borges - 17 Years Ago
Trent L. Taylor - 17 Years Ago
Larry Tucker - 17 Years Ago
Ivan George Borges - 17 Years Ago
Peter Denton - 17 Years Ago
Larry Tucker - 17 Years Ago
Larry Tucker - 17 Years Ago
Peter Denton - 17 Years Ago
Larry Tucker - 17 Years Ago
Peter Denton - 17 Years Ago
Trent L. Taylor - 17 Years Ago
Larry Tucker - 17 Years Ago
Trent L. Taylor - 17 Years Ago
Peter Jones - 17 Years Ago
Ger Cannoll - 17 Years Ago
Trent L. Taylor - 17 Years Ago

Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search