I can not use config files, I have to init database connetcion in runtime. It's SQL Server 2008 database.

Since I updated EF to newer ADO.NET Entity Framework 4.1 - Update 1, Database.Connection.ConnectionString does not work for me any more. Connection string in config file works fine for me, but I need to define it dynamically. So I found other popular way to do it by DefaultConnectionFactory like this: 

```
Database.DefaultConnectionFactory = 
    new SqlConnectionFactory("Server=local;Initial Catalog=Db1;Trusted_Connection=True;")

```

However in the case I got the error message trying to access any DbSet derived object: *The provider did not return a ProviderManifestToken string. ---> System.Data.SqlClient.SqlException: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)*

UPDATE: I experience the issue only in the case database is not yet created and supposed to be rebuild by EF. In case it exists, no such exception occurs as I query Db for data. If I define exactly the same connection string in config files, both cases works fine for me (database generation and data query)

What am I doing wrong? 
Thanks