config files in 3 tier application

4 posts, 1 answers
  1. richardFlow
    richardFlow avatar
    62 posts
    Member since:
    Jun 2012

    Posted 29 Jul 2010 Link to this post

    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!
  2. Answer
    Damyan Bogoev
    Admin
    Damyan Bogoev avatar
    581 posts

    Posted 29 Jul 2010 Link to this post

    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
  3. DevCraft banner
  4. richardFlow
    richardFlow avatar
    62 posts
    Member since:
    Jun 2012

    Posted 09 Sep 2010 Link to this post

    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!
  5. Damyan Bogoev
    Admin
    Damyan Bogoev avatar
    581 posts

    Posted 15 Sep 2010 Link to this post

    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
Back to Top