Enterprise Library 5.0

Apr 1, 2014 at 12:11 PM
I'm having problem with my website when I try to post it at HostGator Hosting. It's giving me an error it is:

The type Database cannot be constructed. You must configure the container to supply this value.

It is just when I try to login to my application using this hosting. I don't have any problem with it when I try the website running in my pc. Can somebody help me please. Thanks in advance.
Apr 3, 2014 at 4:56 AM
This message means that the database was not configured properly. You need to create a connectionString entry in the web.config and when creating the database use this name (e.g. CreateDatabase("connectionStringName")). That assumes you are using XML configuration.

If you are using programmatic configuration I wouldn't expect to see that message. You might see that error if the hosting provider has not configured the DbProviderFactories in the machine.config (http://msdn.microsoft.com/en-us/library/dd0w4a2z(v=vs.110).aspx)

If that doesn't help then post a code sample along with the configuration and any other pertinent information about the environment (since the error is related to deployment/configuration/environment).

Randy Levy
Enterprise Library support engineer
Support How-to