It is completely possible to read the web.config if your code is on a separate assembly or not.
For example, Entity Framework data models are usually put a separate project so that it could be reusable and entity framework model needs a connection string from web.config unless you provide one inside the constructor.
As an instance, the below method will return connectionString named myConn:
public string GetMyConn() {
return System.Configuration.
ConfigurationManager.ConnectionStrings["MyConn"].ToString();
}
UPDATE
I am not sure what do you want here but if you want to make the ConnectionString name changeable, do it this way:
public string GetMyConn(string connStr) {
return System.Configuration.
ConfigurationManager.ConnectionStrings[connStr].ToString();
}
The point here is that you can access them from a different assembly as well.