The text template engine doesn't know about your project's app.config file, regardless of whether it contains entlib configuration or not.
You could try to load the configuration file manually, either by reading the raw xml or creating a FileConfigurationSource on it and pass it to create an instance of the DatabaseProviderFactory class to get your Database instance.