Multiple databases depending in the url string

Thread is closed for posting
2 posts, 0 answers
  1. Rodolfo Villanueva
    Rodolfo Villanueva avatar
    2 posts
    Member since:
    Jan 2010

    Posted 13 Nov 2012 Link to this post

    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.




  2. Ady
    Ady avatar
    589 posts

    Posted 14 Nov 2012 Link to this post

    Hi Rodolfo,

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

    Kind regards,
    the Telerik team
    Telerik OpenAccess ORM Meets ASP.NET Web API. Read more.
Back to Top