Cant add Business Object to a form


Author
Message
Ger Cannoll
Ger Cannoll
Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)
Group: StrataFrame Users
Posts: 430, Visits: 507
Just started to set up test app.

I have created a business object, and added it to an New Project. I've also added a Maintenence Form. Am in the maintenance from and am trying to add the bsuiness object. I have 2 problems:

1. From the Miantenece Form, I click on Toolbox, but cant see a buisness object anywhere to add.

2. If I F5 to compile and run the form, it comes up with a Database Connection Wizard, defaulting to Sql Server and asking me to select a Database. I am not sure what this is for.. The buisness object I have set up is based on a VFP database.

Rogerio Mauri
Rogerio Mauri
StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)StrataFrame User (303 reputation)
Group: StrataFrame Users
Posts: 205, Visits: 629
Olá...

It shows images (PrintScreen) for one better analysis.

Rogério Mauri Smile



Edhy Rijo
E
StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Hi Gerard,

1. From the Miantenece Form, I click on Toolbox, but cant see a buisness object anywhere to add.

When working with your BO, you must rebuild the BO's project in order to see it in the toolbox.

2. If I F5 to compile and run the form, it comes up with a Database Connection Wizard, defaulting to Sql Server and asking me to select a Database. I am not sure what this is for.. The buisness object I have set up is based on a VFP database.

I have not tried connecting to VFP tables, but the Connection Wizard will show up whenever a connection is not defined for your project, usually the first time the application is run, you can control this in the AppMain.vb file.

Edhy Rijo

Ger Cannoll
Ger Cannoll
Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)
Group: StrataFrame Users
Posts: 430, Visits: 507
Still cannot see Buisness Object in Toolbox. Where is it supposed to be ? I can see in toolbox, sections Srataframe Controls & components, ANOther Componets, All Windows Forms. Should it be under Strataframe or in a section on its own

Also, I still have no lucj when comiling the test app... its still looking for a databse and I am not sure on what goes in here

Edhy Rijo
E
StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Hi Gerarld,

Here are the steps to create a BO:

  1. Create a BO class based on StrataFrame BO class.
  2. Open the Business Object Mapper (BOM)
    • Map your class with your table.
    • In the BOM build the Partial Class for your BO.
    • Close the BOM.
  3. In VS IDE Build your BO project or the whole solution, then open the form and the BO classes will appear in the ToolBox.  In my case I created a Business Object Project Library named IBS_BOL, so it will show in the ToolBox as IBS_BOL Components



Edhy Rijo

Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
1. From the Miantenece Form, I click on Toolbox, but cant see a buisness object anywhere to add.

They will not appear for 1 of 3 reasons.  1.) Your project that contains the assemblies has not been built. 2.) The business objects that you are trying to include are not in a project within the solution 3.) Your preferences are setup to prevent any custom control from automatically appearing within the toolbox.  You can set this by opening VS and then clicking Tools -> Options -> Windows Forms Designer -> AutoPopulateToolbox

2. If I F5 to compile and run the form, it comes up with a Database Connection Wizard, defaulting to Sql Server and asking me to select a Database. I am not sure what this is for.. The buisness object I have set up is based on a VFP database.

You need to configure your AppMain to either setup the data sources for your application manually, or if you plan to use the Connection Wizard, you will need to setup the required data source items.  By default, the template has an SQLDataSourceItem in this list...so you will need to change this.  You can look through the docs on this as well, but you will want to modify your AppMain, open the SetDataSources method, and then change the AddRequiredDataSource call to meet your needs...or you could just manually set the DataSources, but in either case, you need to setup the data sources for your application.

Ger Cannoll
Ger Cannoll
Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)
Group: StrataFrame Users
Posts: 430, Visits: 507
They will not appear for 1 of 3 reasons.  1.) Your project that contains the assemblies has not been built. 2.) The business objects that you are trying to include are not in a project within the solution 3.) Your preferences are setup to prevent any custom control from automatically appearing within the toolbox.  You can set this by opening VS and then clicking Tools -> Options -> Windows Forms Designer -> AutoPopulateToolbox

Ok. I have created the DLL for business objects and am trying to access these in a separate project. I have gone through creating anew Tab in the toolbox, and added in the business Object Dll.I can now see this in the toolbox, but when I clixk the +, all I get is a Pointer option. I cant see the actual Busines Object .

Edhy Rijo
E
StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)StrataFrame VIP (4.6K reputation)
Group: StrataFrame Users
Posts: 2.4K, Visits: 23K
Hi Gerard,

I believe you have to add a reference to the BO project in the project you want to use them.  Simply go to your project's reference tab and add the BO project, so it can be seen by the new project.  I don't think you have to add a new Tab or do nothing else.

Edhy Rijo

Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
Actually, if you have manually created a toolbox tab and added the BOs manually to the tab, it will automatically add a reference when dropped on the form.  I am not sure exactly where you are having trouble.  So I just created a quick video that should hopefully get you going down the right path.
Attachments
QuickBOSample.zip (99 views, 16.00 MB)
Ger Cannoll
Ger Cannoll
Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)Advanced StrataFrame User (630 reputation)
Group: StrataFrame Users
Posts: 430, Visits: 507
You need to configure your AppMain to either setup the data sources for your application manually, or if you plan to use the Connection Wizard, you will need to setup the required data source items.  By default, the template has an SQLDataSourceItem in this list...so you will need to change this.  You can look through the docs on this as well, but you will want to modify your AppMain, open the SetDataSources method, and then change the AddRequiredDataSource call to meet your needs...or you could just manually set the DataSources, but in either case, you need to setup the data sources for your application.

I think I need a bit of guidance here as to best practise. We will be decveloping an App on my machine,say database is in c:\MyApp) and deploying it to clients server (say F:\Apps\KillerApp) in ClientA and G:\Applications\BestApp in Client B. So will need to set up a table/file to hold connection strings. I am unclear where to put this 'stuff' in the Strataframe app. I know when I am setting up the Business Object I specify a connection string , but I understand this is just for development purposes.

In  summary, some guidance on   a)What to do and    b)where in the Stratframe App   I need to set up these strings   would be appreciated

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