Mapping a BO to a Stored Procedure...


Author
Message
StarkMike
StarkMike
Advanced StrataFrame User (738 reputation)Advanced StrataFrame User (738 reputation)Advanced StrataFrame User (738 reputation)Advanced StrataFrame User (738 reputation)Advanced StrataFrame User (738 reputation)Advanced StrataFrame User (738 reputation)Advanced StrataFrame User (738 reputation)Advanced StrataFrame User (738 reputation)Advanced StrataFrame User (738 reputation)
Group: Forum Members
Posts: 436, Visits: 944
I want to fill a listview using a stored procedure. I like the simplicity of the business object method, however I'm not sure you can base a BO on a stored procedure. I have it working...kind of. I created a view that is identical to the stored procedure so that I can create a BO based on the view and then I call the stored procedure in the fill method of the BO class. Am I able to base a business object on a stored procedure or could you suggest a better way? I don't necessarily want to create a view for every stored procedure that I want to base a BO on.



Thanks
Replies
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
If you are using the results of the stored procedure to create the list view, you can actually use any business object you want to.  Here's how it works.  When you set the PopulationDataSourceSettings for the list view, you'll notice that when adding a new Display Field, you have the drop down list of the available fields, however in that drop down list, you can type anything you need into the blank.  So, you can use any business object, regarless whether is has the same structure as the stored procedure results, and manually type in the Display Fields.  When the list builds, the list will determine that the fields do not belong on the business object, and will pull them from the internal DataTable (even though the properties don't exist).  So, you can build ListViews all day long without a business object that matches the structure, however, if you want to work with the results of the stored procedure in code (unlikely, since you cannot save your changes to it), you won't have the strong typed properties to work with.

Hopefully that makes sense Smile

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
We are planning to eventually allow you to build a business object off of a stored procedure, but at the moment, we don't have that functionality.
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search