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

Replies
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
Peter and Trent,

Thanks very much for your input and suggestions.  I'm making good headway learning SF because of this good support. 

As a small aside, Trent, I notice you include a table prefix in all our field names (e.g.,  Pharmacy.ph_Name).  Just curious how that helps.  Is it to avoid duplicate field names in JOINS?  Since I am essentially rebuilding some VFP applications almost from scratch, I'm open to anything that prevents problems down the road.

Larry

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
Just curious how that helps.  Is it to avoid duplicate field names in JOINS? 

It's kindof funny how when a certain topic comes up it comes up everywhere.  It seems like I have had this converstaion a lot lately Smile

Yeah, prefixes are a really good standard because it can uniquely separate one table from another.  This is a standard that I learned when I first started in the business and it turned out to be a good one.  This is especailly helpful when you start producing more complex queries such as JOINS or pulling values froma SPROC or VIEW.  Say for example that you have a field named CreatedDate in two different tables, you then have to *** an AS clause for every field in the query that is going to return a CreatedDate otherwise you will have an ambiguous field name.  SQL Server is much more forgiving when it comes to naming fields than VFP, but having prefixes has really reduced the complexity of some of my queries over time.

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