Set dynamic ConnectionString Entity Framework-Collection of common programming errors

I developed Asp.net application with Entity Framework and now i need to change entity connection string at run time.I tried following way.

public class DataLayer(){

static DataLayer()
{
((EntityConnection)_dbEntity.Connection).StoreConnection.ConnectionString =    GetConnectionString();

//GetConnectonString() returns "user id=xxxx;password=xxxx;database=xxxx;server=xxx.xxx.xx.xx"
}

static DBContext _dbEntity = new DBContext();
//other codes
}

And I checked following links too.Still I couldn’t change it.

http://msdn.microsoft.com/en-us/library/bb738533(v=vs.90).aspx

http://social.msdn.microsoft.com/Forums/en-US/adodotnetentityframework/thread/8a89a728-6c8d-4734-98cb-11b196ba11fd