Backend configuration to azure.

7 posts, 0 answers
  1. E
    E avatar
    2 posts
    Member since:
    Sep 2012

    Posted 12 Sep 2012 Link to this post

    Im trying to use sql azure database with telerik orm. I was able to create a rlinq file with schema, but when im tring to querry some objects i got error -  Wrong database backend configuration detected , it says that server where it tryes to connect is sql server but confugured as azure.
  2. Ady
    Admin
    Ady avatar
    589 posts

    Posted 13 Sep 2012 Link to this post

    Hello,

     When you use the 'Domain Model' wizard and specify the connection string, you also have an option to select the backend. The default is SqlServer; but you should select 'SQL Azure' there. If you leave it as SqlServer, OpenAccess can read the schema because the connection string is valid but the generated rlinq file is configured for SqlServer.

    Do get back in case you need further assistance.

    Greetings,
    Ady
    the Telerik team
    Follow @OpenAccessORM Twitter channel to be the first one to get the latest updates on new releases, tips and tricks and sneak peeks at our product labs!
  3. DevCraft banner
  4. Grant Drury-Green
    Grant Drury-Green avatar
    23 posts
    Member since:
    Jul 2009

    Posted 12 Oct 2012 Link to this post

    Not sure how to work with this in practice.

    I develop against a local Sql 2008 (Express) database, and deploy to Sql Azure.

    From what I'm reading I have to compile 2 different assemblies to target the different back ends?? Having an environment specific assembly is not my idea of a good time...

    Can this be done via configuration? Any other suggestions?
  5. Ady
    Admin
    Ady avatar
    589 posts

    Posted 15 Oct 2012 Link to this post

    Hi ,

     You can add another constructor to the class that takes in BackendConfiguration instance and a connection string - as below

    public partial class EntityDiagrams2
       {
           public EntityDiagrams2(string connection, BackendConfiguration backendConfiguration)
               : this(connection, backendConfiguration, metadataSource)
           {
     
           }
       }

    You can this use this constructor with an explicit BackendConfiguration instance which sets the backend to 'Azure' - new BackendConfiguration {     Backend = "Azure", ProviderName = "System.Data.SqlClient"}).

    Alternatively you can factor out the GetBackendConfiguration generated method to provide the appropriate backend configuration.

    Do get back in case you need further assistance.


    Kind regards,
    Ady
    the Telerik team
    Telerik OpenAccess ORM Meets ASP.NET Web API. Read more.
  6. Fawad
    Fawad avatar
    38 posts
    Member since:
    May 2009

    Posted 12 Feb 2013 Link to this post

    Old thread but thanks a lot for that tip Ady, solved my problem too. :)

    Regards.
  7. Magnus
    Magnus avatar
    1 posts
    Member since:
    Aug 2013

    Posted 06 Apr in reply to Ady Link to this post

    Hi,
    Is this metod still compatible with version 2015.1.225 of DataAccess? (As I have not yet migrated to the NuGet-based version).
    If so, can you please elaborate where, in which files, I should put the code in your example.

    Regards.

  8. Ady
    Admin
    Ady avatar
    589 posts

    Posted 08 Apr Link to this post

    Hi Magnus,

     Are you still using the Visual Studio designer to generate the context?
    You can put the code in a partial 'OpenAccessContext' class. The designer will generate an 'OpenAccessContext' derived  class for you. You should create a partial class for this and put the code there.

    Do get back in case you need further assistance.

    Regards,
    Ady
    Telerik
     
    Check out the latest announcement about Telerik Data Access vNext as a powerful framework able to solve core development problems.
Back to Top
DevCraft banner