So your right. That was actually calling other custom code. Sorry - I was quickly copying and pasting that before I went to bed. Whoops.
The bit you want is something like:
NetTiersProvider provider = null;
provider = new SqlNetTiersProvider();
NameValueCollection collection = new NameValueCollection();
collection.Add("ConnectionString", connectionString);
collection.Add("ConnectionStringName", key);
collection.Add("UseStoredProcedure", "false");
collection.Add("EnableEntityTracking", "false");
collection.Add("EntityCreationalFactoryType", "<project name>.Entities.EntityFactory");
collection.Add("EnableMethodAuthorization", "false");
collection.Add("ProviderInvariantName", "System.Data.SqlClient");
provider.Initialize(providerKey, collection);
DataRepository.LoadProvider(provider, true);