This is a migrated thread and some comments may be shown as answers.

config files in 3 tier application

3 Answers 81 Views
Development (API, general questions)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
richardFlow
Top achievements
Rank 1
richardFlow asked on 29 Jul 2010, 10:14 AM
Hi,

I have a website, that uses a BLL class which in turn talks to the DAL which has the persistant objects.  The BLL converts the DAL objects into Business Objects that have NO link to OpenAccess, so our website in turn has no connection to OpenAccess. 

I want to be able to set the database connection strings in the web.config file, but am having great problems in doing so.

Currently i'm getting an error as follows:

Cannot find section 'backendconfiguration' with id 'mssqlConfiguration'.
See History property for more details. 

Could you maybe outlinle in detail how i enable the projects or set up the config files to enable the database connections to flow down to the DAL. In all your examples it seems to be just a website talking to the DAL, but i need to go via the BLL, and I can't get it to work.

Thanks!

3 Answers, 1 is accepted

Sort by
0
Accepted
Damyan Bogoev
Telerik team
answered on 29 Jul 2010, 05:42 PM
Hello Web Belief Ltd,

I advice you reading this help article which explains the backendconfiguration section. The main help article demonstrates what the format of the configuration file should look like. You could specify the backendconfiguration within the web.config using the following approach:

<openaccess xmlns="http://www.telerik.com/OpenAccess">
<connections>
  <connection id="DbConnection">
    <connectionString>Data Source=datasource;Initial Catalog=DatabaseName;Integrated Security = True</connectionString>
    <backendconfigurationname>mssqlConfiguration</backendconfigurationname>
  </connection>
</connections>
<backendconfigurations>
  <backendconfiguration id="mssqlConfiguration" backend="mssql">
    <mappingname>mssqlMapping</mappingname>
  </backendconfiguration>
</backendconfigurations>
...
</openaccess>

Hope that helps.

Regards,
Damyan Bogoev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
richardFlow
Top achievements
Rank 1
answered on 09 Sep 2010, 07:04 PM
I'm sorry, but i don't think this answer addresses the issue. The example given has two tiers. I have a DAL assembly with the persistant objects, a BLL assembly and then the website assembly which i intend to have no reference to openaccess at all.  i want to be able to use a connection string from the standard <connectionStrings> section of my web.config file to control the db used by the DAL.

Could you please give an example containing the 3 config files and any code required on the BLL to get the connection string from the website if this is necessary.

Thanks!
0
Damyan Bogoev
Telerik team
answered on 15 Sep 2010, 08:06 AM
Hello Web Belief Ltd,

I think you will find useful our example of "Using Telerik OpenAccess ORM and WPF". It demonstrate how to implement n-tier applications with Telerik OpenAccess ORM. There are two versions available - one with the "classic" object scope approach and another with a domain model.
Hope that helps. If any other questions arise please contact us back.

Sincerely yours,
Damyan Bogoev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Development (API, general questions)
Asked by
richardFlow
Top achievements
Rank 1
Answers by
Damyan Bogoev
Telerik team
richardFlow
Top achievements
Rank 1
Share this question
or