﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » StrataFrame Application Framework - V1 » Business Objects and Data Access (How do I?)  » FillByStoredProcedure v. BOM</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Tue, 29 Sep 2026 02:10:48 GMT</lastBuildDate><ttl>20</ttl><item><title>FillByStoredProcedure v. BOM</title><link>http://forum.strataframe.net/FindPost23321.aspx</link><description>Greetings. &lt;br&gt;
&lt;br&gt;
Two questions about business object mapping and FillByStoredProcedure( )...&lt;br&gt;
&lt;br&gt;
1.) In a reply somewhere out here (I believe possibly from Ben) there was a indication that the BOM would allow mapping of a business object to a stored procedure as part of the 1.4.1 release. I'm not seeing anything that would allow that, and am running the 1.6.7. Was that option scratched, or is it hiding from me? &lt;br&gt;
&lt;br&gt;
2.) Not withstanding new information I may get from replies to the above, I have a business object mapped to a SQL Server table. I will be giving users UI controls that will eventually trigger a call to BO Fill methods that will wrap calls to FillByStoredProcedure( ). Do the stored procedures called need to return datasets that are positional with respect to the columns the BOM knows about (i.e., data fields must be in the same sequence as the CreateTableSchema( ) in the BO's designer file), or have the same column/field names? &lt;br&gt;
&lt;br&gt;
3.) Let's talk Browse! How would I go about customizing the Browse dialog to allow for searching based on columns not mapped in the BOM? This question will, of course, lead to discussions about the new OverrideSearchTableName/Schema, which I will look at. That may or may not be the solution, depending on whether--for my purposes--I can setup a view (or, I guess, views and programmatically change the Override.... properties just before calling the BD.showDialog()) that handles all possible searches the users will want to construct. If it does, great. If not, I'm hoping the flexibility of calling a stored procedure from the BD is feasible. &lt;br&gt;
&lt;br&gt;
TIA</description><pubDate>Wed, 03 Jun 2009 16:31:58 GMT</pubDate><dc:creator>Alex Luyando</dc:creator></item><item><title>RE: FillByStoredProcedure v. BOM</title><link>http://forum.strataframe.net/FindPost23338.aspx</link><description>LOL...I don't think your giving yourself enough credit!  But I know where you are coming from...been there a number of times myself...TODAY! :D</description><pubDate>Wed, 03 Jun 2009 16:31:58 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: FillByStoredProcedure v. BOM</title><link>http://forum.strataframe.net/FindPost23337.aspx</link><description>LOL After going back to my code it looks like I ended up using the FillDataTable( ) method anyway. So, goes to show you that even a blind squirrel can get a nut every once in a while. &lt;br&gt;
&lt;br&gt;
Thanks.</description><pubDate>Wed, 03 Jun 2009 16:31:04 GMT</pubDate><dc:creator>Alex Luyando</dc:creator></item><item><title>RE: FillByStoredProcedure v. BOM</title><link>http://forum.strataframe.net/FindPost23326.aspx</link><description>Sounds good :)</description><pubDate>Wed, 03 Jun 2009 10:06:38 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: FillByStoredProcedure v. BOM</title><link>http://forum.strataframe.net/FindPost23325.aspx</link><description>Thanks Trent. I'll see how far this takes me. &lt;br&gt;
________________&lt;br&gt;
_____/ Regards,   &lt;br&gt;
____/ al      &lt;br&gt;</description><pubDate>Wed, 03 Jun 2009 10:05:29 GMT</pubDate><dc:creator>Alex Luyando</dc:creator></item><item><title>RE: FillByStoredProcedure v. BOM</title><link>http://forum.strataframe.net/FindPost23323.aspx</link><description>[quote]1.) In a reply somewhere out here (I believe possibly from Ben) there was a indication that the BOM would allow mapping of a business object to a stored procedure as part of the 1.4.1 release. I'm not seeing anything that would allow that, and am running the 1.6.7. Was that option scratched, or is it hiding from me?[/quote]&lt;br&gt;
&lt;br&gt;
Pulling from a stored procedure is not a possibility (at least for now) as this would require a number of things to be changed including the ability to setup parms as part of the mapper to retrieve the query.  Since a SPROC is not an actual mapped schema element, it cannot be directly mapped.  However, you CAN map to a view.  This may have been the post to which you were referring.&lt;br&gt;
&lt;br&gt;
[quote]2.) Not withstanding new information I may get from replies to the above, I have a business object mapped to a SQL Server table. I will be giving users UI controls that will eventually trigger a call to BO Fill methods that will wrap calls to FillByStoredProcedure( ). Do the stored procedures called need to return datasets that are positional with respect to the columns the BOM knows about (i.e., data fields must be in the same sequence as the CreateTableSchema( ) in the BO's designer file), or have the same column/field names?[/quote]&lt;br&gt;
&lt;br&gt;
First, on this point, you will most likely be better off just calling FillDataTable and building a the command versus using the FillBy StoredProcedure method.  You will have more contrl this way.  For example:&lt;br&gt;
&lt;br&gt;
[codesnippet]SqlCommand cmd = new SqlCommand("dbo.MyStoredProcedure");&lt;br&gt;
&lt;br&gt;
//-- Set the command type (this will force the command to execute a SPROC versus an SQL statement)&lt;br&gt;
cmd.ComandType = SqlCommandType.StoredProcedure;&lt;br&gt;
&lt;br&gt;
//-- Add any parms&lt;br&gt;
cmd.Parameters.Add("@parm1", SqlDbType.BigInt).Value = Val1;&lt;br&gt;
&lt;br&gt;
//-- Now fill the BO with the result set&lt;br&gt;
this.FillDataTable(cmd);[/codesnippet]&lt;br&gt;
&lt;br&gt;
The second part of your question.  If you are going to be using the fieklds to which you have mapped (instead of a custom property) then yes, you will need to make sure that the result set that comes back from the SPROC matches the schema mapped.  If you are going to have variable field names coming back, then you could take this into the equation by creating a custom property (or multiple) which takes this logic into account.&lt;br&gt;
&lt;br&gt;
[quote]3.) Let's talk Browse! How would I go about customizing the Browse dialog to allow for searching based on columns not mapped in the BOM? This question will, of course, lead to discussions about the new OverrideSearchTableName/Schema, which I will look at. That may or may not be the solution, depending on whether--for my purposes--I can setup a view (or, I guess, views and programmatically change the Override.... properties just before calling the BD.showDialog()) that handles all possible searches the users will want to construct. If it does, great. If not, I'm hoping the flexibility of calling a stored procedure from the BD is feasible.[/quote]&lt;br&gt;
&lt;br&gt;
You can get pretty crazy with the overriding logic now days on the BrowseDialog...but before going crazy here, might I first suggest just creating a view and then changing the OverRideSearchTableName...this will be the least complicated road to travel.</description><pubDate>Wed, 03 Jun 2009 09:10:09 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item></channel></rss>