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

Multiple databases depending in the url string

1 Answer 76 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Rodolfo Villanueva
Top achievements
Rank 2
Rodolfo Villanueva asked on 13 Nov 2012, 10:12 PM

Hi, I justo want to change the connection string, (I have two in my web.config), depending of the Request.ServerVariables("HTTP_HOST"). In other words, I need that my web site connects to a certain database depending on the url. The problem is that I am using many OpenAccessDataSource objects, so a solution like: Using dbcontext As New ModeloEntidades("DBConnetion1"), doesn´t work for me.

 

 

Regards. 

1 Answer, 1 is accepted

Sort by
0
Ady
Telerik team
answered on 14 Nov 2012, 01:53 PM
Hi Rodolfo,

 You could try and use the 'ContextCreating' event of the OpenAccessDataSource and specify an appropriate context based on the URL.

Kind regards,
Ady
the Telerik team
Telerik OpenAccess ORM Meets ASP.NET Web API. Read more.
Tags
General Discussions
Asked by
Rodolfo Villanueva
Top achievements
Rank 2
Answers by
Ady
Telerik team
Share this question
or