I've multiple databases say DB1, DB2, DB3 and MembershipDB. Every Database has GUID column named ApplicationID &lifier group of Customers getting MembershipID as GUID. Each User of each and every Database is Isolated (don't have any relationship) with User of other Database. Membership Database consists of the Customers MembershipID and Database’s ApplicationID , password, username, email etc.

I have to produce a common login system like Whenever a user provides his login credential authentication will be done from MembershipDB and the data will be fetched in the database he's registered to.
Eg: a person from DB1 provides his login particulars, authentication is performed from membershipDB. Now relaxation of his data will be fetched from DB1(because he is registered to DB1) to his dashboard. I'm bit confuse building this login system.
Authentication part isn't any problem. But exactly how for connecting towards the correct DB to obtain the correct data for that user.
All of the valuable comments and suggestions are welcome.

I'm using Microsoft SQL SERVER 2008, Entity Framework 4.2 (database ist approach), WCF, asp.internet MVC 4

in member ship DB, you ought to have a column that record which database this use goes to for instance: id, username,password, applicationid, email, DBName

select * from membershipdb where username='user1', and password = 'password1'.
//Code to fetch the database
//rs = recordset
//This assume these two database in same server
String DB = rs.getString(6) // 6 is DBName

DBobj->executeQuery("USE "+DB);
DBobj->executeSelect("select * from DB1.Table1 where Column1 = 'column1'");

//when the Database have been in different servers, you are able to connect with server 2 and assign to DBobj2 //Then make use of the similar method as above

Basically understood you properly you will want for connecting to various databases dynamically without modifying your code. Allows assume you've 2 clients Customer1 and Customer2. You produced 2 databases with names Database_Customer1 and Database_Customer2 of these clients.

Map entity framework with the Customer's database with title 'CustomerDbSpecificEntities'.

Now you have to add following connection strings inside your .config file.

<add name="Database_Customer1_Entities" connectionString="metadata=res://*/CustomerDbSpecific.csdl|res://*/CustomerDbSpecific.ssdl|res://*/CustomerDbSpecific.msl;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=Customer1ServerName;Initial Catalog=DatabaseCustomer1;Persist Security Info=True;User ID=userid;Password=password;MultipleActiveResultSets=True&quot;" providerName="System.Data.EntityClient" />
<add name="Database_Customer2_Entities" connectionString="metadata=res://*/CustomerDbSpecific.csdl|res://*/CustomerDbSpecific.ssdl|res://*/CustomerDbSpecific.msl;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=Customer2ServerName;Initial Catalog=DatabaseCustomer2;Persist Security Info=True;User ID=userid;Password=password;MultipleActiveResultSets=True&quot;" providerName="System.Data.EntityClient" />

Inside your code in Data Access Layer,

String ConnectionStringName = MembershipDBProvider.GetConnectionStringNameForCustomer(CustomerName);
using (CustomerDbSpecificEntities context = new CustomerDbSpecificEntities("Name=" + ConnectionStringName))
        //use context here

Produce a table (CustomerDbConnection) in keeping database (membership database) to keep mapping of Customer Title and it is database connection string title.

'GetConnectionStringNameForCustomer(CustomerName)' searches in CustomerDbConnection table and returns the bond string reputation for given customer. Which is often used to established the bond to customer specific database.

Now for those who have new customer later on then make following changes, 1. Add new row in CustomerDbConnection. 2. Add new connection string insconfig file

Please tell me if you want more in depth about this.