BO's & Stored Procedures


Author
Message
Philipp Guntermann
Philipp Guntermann
StrataFrame User (249 reputation)StrataFrame User (249 reputation)StrataFrame User (249 reputation)StrataFrame User (249 reputation)StrataFrame User (249 reputation)StrataFrame User (249 reputation)StrataFrame User (249 reputation)StrataFrame User (249 reputation)StrataFrame User (249 reputation)
Group: Forum Members
Posts: 141, Visits: 263
Hi,

this is possible a very common question, but searching the forums and reading through the documentation still left me kind of clueless of how to accomplish the following scenario:

i have two tables:

theese translate to "MainCategories" and "SubCatergories".

I further have the following sproc, that returns a joined resultset from theese tables:

set ANSI_NULLS ON

set QUOTED_IDENTIFIER ON

GO

ALTER PROCEDURE [dbo].[spG_LeseWarengruppenMitObergruppen] AS

SELECT W.ID,

W.Bezeichnung AS 'Warengruppe',

O.Bezeichnung AS 'WarenObergruppe'

FROM tbWarengruppen W INNER JOIN tbWarenObergruppen O

ON W.tbWarenObergruppen_ID = O.ID

 

Now how would i got to get this resultset into a BO ? When i use the BO-Mapper, i can only select a table from the database directly.

I read the portion about custom field properties aswell and at first thought that was what i been looking for. For a quick test i wrote the following custom property field code into the bo code:

#region Custom Field Properties

[Browsable(true), BusinessFieldDisplayInEditor(), Description("WarenObergruppe"), DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]

public string WarenObergruppe

{

get { return this.WarenObergruppe; }

}

protected override MicroFour.StrataFrame.Business.FieldPropertyDescriptor[] GetCustomBindablePropertyDescriptors()

{

return new FieldPropertyDescriptor[] { new ReflectionPropertyDescriptor("WarenObergruppe", typeof(WarengruppenBO)) };

}

#endregion

My Impression was, that this custom field property would now appear inside the buisness object mapper along with the other fields, and that i could just rename the field "Bezeichnung" to Warengruppe aswell as "removing" the fields ID and tbWarenObergruppen_ID to match up with the resultset that my sproc returns.

however, both assumtions turned out to be wrong.

So the question remains:

how do i "map" my sproc's resultset to a BO ?

Thanks.


Replies
Philipp Guntermann
Philipp Guntermann
StrataFrame User (249 reputation)StrataFrame User (249 reputation)StrataFrame User (249 reputation)StrataFrame User (249 reputation)StrataFrame User (249 reputation)StrataFrame User (249 reputation)StrataFrame User (249 reputation)StrataFrame User (249 reputation)StrataFrame User (249 reputation)
Group: Forum Members
Posts: 141, Visits: 263
Trent L. Taylor (09/25/2008)
umm, so what you are saying is that the BOM/BO's does/do not support views ?

NO!!!!! That is not what I am saying at all!!!! w00t  I am saying that when you are mapping a BO to a view that the DDT, though it will deploy views just fine, doesn't regex out and parse all of the individual field names to which the BO would be getting mapped.  That is why, when mapping a BO through the BO Mapper to a view you have to pull the schema from a view already associated with a server.  So if you are using the DDT, deploy the view first, then map the BO to the view by pulling the schema from teh deployed SQL Server database.

tehe, glad that was not what you were saying ^^

i understood, that in order to map to views, i need to select "SQL Server" as Datasource within the BOM, for the reasons you explained.

i think right now, my main question in regards to this is:

When i select "SQL Server" as source in the BOM, it will ask me for the connection details. I could off course just enter them, but then what will happen when i deploy the application at a customer, who has different connection details to his sql server.

i read the connection details from an xml file, and add it as datasource through the code.

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 think that you misunderstand what these connections are for.  They are not tied or associated with the BO in any way, shape, or form.  They are definiltey not needed at the customer site.  These connection string are ONLY used when trying to pull a schema to build the strong-typed properties for a BO...period.  These are are only used while you are mapping and nothing else.  The connection strings used for connecting to data are set through the DataSources and generally set in the AppMain.vb or program.cs files in the SetDataSources method...or through the Connection String wizard.  You can refer to the help docs for more information there.
Philipp Guntermann
Philipp Guntermann
StrataFrame User (249 reputation)StrataFrame User (249 reputation)StrataFrame User (249 reputation)StrataFrame User (249 reputation)StrataFrame User (249 reputation)StrataFrame User (249 reputation)StrataFrame User (249 reputation)StrataFrame User (249 reputation)StrataFrame User (249 reputation)
Group: Forum Members
Posts: 141, Visits: 263
Trent L. Taylor (09/25/2008)
I think that you misunderstand what these connections are for.  They are not tied or associated with the BO in any way, shape, or form.  They are definiltey not needed at the customer site.  These connection string are ONLY used when trying to pull a schema to build the strong-typed properties for a BO...period.  These are are only used while you are mapping and nothing else. 

ah now i get what the mapper actually does. ^^

Thanks BigGrin

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Threaded View
Threaded View
Philipp Guntermann - 17 Years Ago
Trent L. Taylor - 17 Years Ago
Michel Levy - 17 Years Ago
Philipp Guntermann - 17 Years Ago
Michel Levy - 17 Years Ago
Philipp Guntermann - 17 Years Ago
Michel Levy - 17 Years Ago
Philipp Guntermann - 17 Years Ago
Michel Levy - 17 Years Ago
Philipp Guntermann - 17 Years Ago
Philipp Guntermann - 17 Years Ago
Trent L. Taylor - 17 Years Ago
Philipp Guntermann - 17 Years Ago
                         No...we don't actually support this becuase we did not want to have to...
Trent L. Taylor - 17 Years Ago
                             [quote][b]Trent L. Taylor (09/25/2008)[/b][hr]No...we don't actually...
Philipp Guntermann - 17 Years Ago
                                 [quote]umm, so what you are saying is that the BOM/BO's does/do not...
Trent L. Taylor - 17 Years Ago
                                     [quote][b]Trent L. Taylor (09/25/2008)[/b][hr][quote]umm, so what you...
Philipp Guntermann - 17 Years Ago
                                         I think that you misunderstand what these connections are for. They...
Trent L. Taylor - 17 Years Ago
                                             [quote][b]Trent L. Taylor (09/25/2008)[/b][hr]I think that you...
Philipp Guntermann - 17 Years Ago

Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search