Database trace listener provider name problem

Topics: Data Access Application Block, Logging Application Block
Oct 29, 2007 at 3:39 AM
I am using db trace listener to log. My web.config file inherits the connection string from a higher level config file on my web host. Unfortunately this connection string does not have the providerName attribute. This causes the db logger to crash.

System.Configuration.ConfigurationErrorsException: The requested database default does not have provider name set in the connection string.
at Microsoft.Practices.EnterpriseLibrary.Data.DatabaseConfigurationView.ValidateConnectionStringSettings(String name, ConnectionStringSettings connectionStringSettings)
at Microsoft.Practices.EnterpriseLibrary.Data.DatabaseConfigurationView.GetConnectionStringSettings(String name)

Any ideas on how I can solve this problem?
Oct 30, 2007 at 4:31 PM
hello...I'd really appreciate some help in figuring out how to programmatically add the providerName to a connection string when logging using db.
Oct 30, 2007 at 5:07 PM
Hi,

There really isn't much you can do about this in your situation. Can't they just add the provider name to the connection string you inherit?

If you were using the connection yourself you could just instantiate the appropriate database type with the connection string you would access from ConfigurationManager.ConnectionStrings, but in this case it's another block consuming the configuration.

Fernando