Latest release and Oracle business object mapping


Author
Message
John Frankewicz
John Frankewicz
StrataFrame Beginner (40 reputation)StrataFrame Beginner (40 reputation)StrataFrame Beginner (40 reputation)StrataFrame Beginner (40 reputation)StrataFrame Beginner (40 reputation)StrataFrame Beginner (40 reputation)StrataFrame Beginner (40 reputation)StrataFrame Beginner (40 reputation)StrataFrame Beginner (40 reputation)
Group: Forum Members
Posts: 36, Visits: 65
Create a Strataframe project and add a business object to it.

Map the business object to an Oracle database.

You get a select oracle table, but at the root node it has SQL server, and under that it has the tables of the database instance. Should the SQL server be named oracle, it is misleading.

You build a partial class and everything is ok.

You try to build and you get the following error:

Error 1 The name 'InitializeComponent' does not exist in the current context C:\VSPrjs\MedSelect.Oncology.Login\MedSelect.Oncology.Login\LoginBusiness.cs 24 13 MedSelect.Oncology.Login

This is a new solution, not one based from previous version.

Other errors:

Error 4 The name 'LoginBusiness_CheckRulesOnCurrentRow' does not exist in the current context C:\VSPrjs\MedSelect.Oncology.Login\MedSelect.Oncology.Login\LoginBusiness.Designer.cs 42 83 MedSelect.Oncology.Login

Error 7 The type or namespace name 'OracleClient' does not exist in the namespace 'System.Data' (are you missing an assembly reference?) C:\VSPrjs\MedSelect.Oncology.Login\MedSelect.Oncology.Login\LoginBusiness.Designer.cs 1014 72 MedSelect.Oncology.Login

I just assumed all references would be placed since you selected oracle.

Am I  doing something or is it an issue that needs fixed?

Replies
Scott
Scott
StrataFrame User (270 reputation)StrataFrame User (270 reputation)StrataFrame User (270 reputation)StrataFrame User (270 reputation)StrataFrame User (270 reputation)StrataFrame User (270 reputation)StrataFrame User (270 reputation)StrataFrame User (270 reputation)StrataFrame User (270 reputation)
Group: Forum Members
Posts: 176, Visits: 1.5K

My guess would be that all you need to do is fill in the database name in the 4th parameter.

//ConnectionManager.AddRequiredDataSourceItem("", "Oracle Connection",
// DataSourceTypeOptions.Oracle, "", "This connection is used by WindowsApplication1.");

Hope this helps\works.
John Frankewicz
John Frankewicz
StrataFrame Beginner (40 reputation)StrataFrame Beginner (40 reputation)StrataFrame Beginner (40 reputation)StrataFrame Beginner (40 reputation)StrataFrame Beginner (40 reputation)StrataFrame Beginner (40 reputation)StrataFrame Beginner (40 reputation)StrataFrame Beginner (40 reputation)StrataFrame Beginner (40 reputation)
Group: Forum Members
Posts: 36, Visits: 65
I needed to add a unique key and then when I ran the application I got a wizzard.

I don't get a runtime exception, but I don't understand the wizzard and I assume this wizzard is a one-time think, which brings about the question where are the username and password stored?

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
So, I guess my question is now, are you working?



First off, some clairification. The Business Object Mapper is only used for design-time creation of the business objects. Once the partial class is built for the business object, the Business Object Mapper ceases to do anything for you. It does not tell the application what table to talk to at runtime; that's your job.



Scott is correct... you have to have the OracleDataSourceItem in the collection at runtime. You can do this one of two ways: you can add your parameters to the ConnectionManager through the AddRequiredConnection() method and the ConnectionManager will show the wizard at runtime, the wizard then takes care of adding the OracleDataSourceItem to the collection. Or, you can add the OracleDataSourceItem to the DataLayer.DataSources collection manually...



The DataSources collection on the DataLayer class specifies the application wide collections at runtime. So, the Business Object Mapper creates the structure of the business object at design-time, while the DataSources collection tells the business object what database to talk to at runtime.



In the code that you pasted in, you have the ConnectionManager.AddRequesteDataSourceItem() method adding a SQL Server required data source... This tells the ConnectionManager, that when you call the SetConnections() method, it needs to configure a SQL Server connection. What you need to do is comment out the SQL Server data source item and un-comment out the Oracle data source item. OR, you can add the OracleDataSourceItem you need manually (which is what the commented code below the ConnectionManager.SetConnections() method is used for.



To answer your last question: where is the connection information stored, it's stored in two encrypted files in the C:\Documents and Settings\All Users\Application Data\MicroFour\ConnectionData folder. When you make the call to ConnectionManager.SetConnections(), it looks at the calls you made to AddRequiredDataSourceItem and decides "hey, the application needs an Oracle connection." It then looks at the files in the folder mentioned above to see if the end-user has already configured this connection. If it doesn't find the information in the files, it pops up the wizard... hence why you saw the wizard when you entered a new data source key.



So, the template creates the calls you need to AddRequiredDataSourceItem. You have to customize them for the database that you need. Hopefully this gets your quesions answered.
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