View Single Post
  #3 (permalink)  
Old January 10th, 2014, 05:27 PM
hdossantos hdossantos is offline
Registered User
Points: 8, Level: 1
Points: 8, Level: 1 Points: 8, Level: 1 Points: 8, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Jan 2014
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts


No, just to be able to define the connection string for LocalSqlServer at the start of my application.
In this way I can create the connection based on aliases and server variables.
no real server name/ip, userid or password will be used in the code (I use SQL Users for connection)

But with some luck I found, a couple of hours ago, was I looking for!

In the web.config I specify custom Providers for the functionalities (Membership, Roles, WebParts, ...) I use that are using LocalSqlServer connection by default, instead I make then point to a Dummy SQL Connection string and I make my custom Provider be based on a SQL provider class (SqlMembershipProvider, SqlRoleProvider, ...) that is defined in my project.
On these SQL Provider classes I override the Initialize method allowing me to bypass the Dummy connection string and create the connection string as I want based on whatever variables I need.

So for me the topic could be claused!

Any way thanks for your help.
Best Regards


Last edited by hdossantos; January 10th, 2014 at 05:29 PM..