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

Backend configuration to azure.

6 Answers 477 Views
Data Access Free Edition
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
E
Top achievements
Rank 1
E asked on 12 Sep 2012, 08:58 AM
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.

6 Answers, 1 is accepted

Sort by
0
Ady
Telerik team
answered on 13 Sep 2012, 02:52 PM
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!
0
Grant Drury-Green
Top achievements
Rank 1
answered on 13 Oct 2012, 04:49 AM
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?
0
Ady
Telerik team
answered on 15 Oct 2012, 12:40 PM
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.
0
Fawad
Top achievements
Rank 1
answered on 12 Feb 2013, 11:31 AM
Old thread but thanks a lot for that tip Ady, solved my problem too. :)

Regards.
0
Magnus
Top achievements
Rank 1
answered on 06 Apr 2016, 09:38 AM

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.

0
Ady
Telerik team
answered on 08 Apr 2016, 09:37 AM
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.
Tags
Data Access Free Edition
Asked by
E
Top achievements
Rank 1
Answers by
Ady
Telerik team
Grant Drury-Green
Top achievements
Rank 1
Fawad
Top achievements
Rank 1
Magnus
Top achievements
Rank 1
Share this question
or