Cant add Business Object to a form


Author
Message
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
Gerard,

I think that you are missing the point of how connection strings work in SF.  You can take several avenues here.   First, you can allow SF to manage the connection strings for you (this pertains to design time OR run-time). 

You can use the ConnectionStringWizard or manually setup the connection strings by manually supplying the connection information to the DataSources collection.

Let's first assume that you are going to use the ConnectionStringWizard, then you will define the RequiredDataSources in teh SetDataSources method of the AppMain.vb or program.cs file.  Then when the SetConnections() method is called, it looks on disk to an encrypted file to see if an "active" connection string exists for the ApplicationKey that is also defined in your SetDataSources method.

The connection is not defined on the BO.  The BO uses a DataSourceKey to determine which connection string it will use.  It pulls this connection information from the DataSources collection (MIcroFour.StrataFrame.Data.DataBasics.DataSources).  By default, this would be an empty string.  But you can have as many connections per app as you need and can route the BOs to whichever connection that you need.

Whether you are using the ConnectionStringWizard or manually defined the connection strings, they BOTH end up in the DataSources collection.

I recommend looking at the help as there is a lot of information here.  You can get to it by opening the help and going to Application Framework -> Application -> WinForms -> Connection Strings

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

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)
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

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 .

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.

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

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 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

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



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