Using Custom Fill Methods on BO


Author
Message
Richard Keller
Richard Keller
StrataFrame User (174 reputation)StrataFrame User (174 reputation)StrataFrame User (174 reputation)StrataFrame User (174 reputation)StrataFrame User (174 reputation)StrataFrame User (174 reputation)StrataFrame User (174 reputation)StrataFrame User (174 reputation)StrataFrame User (174 reputation)
Group: Forum Members
Posts: 84, Visits: 324
 When creating a Custom Fill Method does the Data Retrieval order have to match the Business Object Definition order or will the BO auto map the fields to the properties based on the column names?

Thanks for your help.

Richard

Reply
StrataFrame Team
S
StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
Gary is correct.  The order of the columns in the returned result set does not matter.  Also, the columns returned to not have to exactly match the field properties on the business object.  On a per-column basis, what Gary said is correct... the name and the data type have to match.  But, you can have more or fewer columns in the return result set than the strong typed field properties on the business object.  If you have a property that doesn't have a corresponding column in the DataTable, you cannot access it (because there's no data behind the property), so don't touch it in code if the field is not in the DataTable.  However, if you have a column in the table that doesn't have a field property, you can access it through the .Item (default/indexer) property like this (comes in handy for joins and aggregate fields like COUNTs and such):

myBO("MyField") = "some value" '-- VB

myBO["MyField"] = "some value"; //-- C#

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View
Threaded View
Richard Keller - 18 Years Ago
Gary Wynne - 18 Years Ago
StrataFrame Team - 18 Years Ago
Bradley Marston - 18 Years Ago
StrataFrame Team - 18 Years Ago
Bradley Marston - 18 Years Ago
StrataFrame Team - 18 Years Ago
Bradley Marston - 18 Years Ago
StrataFrame Team - 18 Years Ago
StrataFrame Team - 18 Years Ago
Bradley Marston - 18 Years Ago
Bradley Marston - 18 Years Ago
StrataFrame Team - 18 Years Ago
Bradley Marston - 18 Years Ago
Trent L. Taylor - 18 Years Ago

Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search