Hi,
I'm receiving the following error:
The type Database cannot be constructed. You must configure the container to supply this value.
Exception Details: System.InvalidOperationException: The type Database cannot be constructed. You must configure the container to supply this value.
Source Error:
Line 168: public DataSet ExecuteDataSet(string strSpName, List<CommandParameter> objLstParameter = null, List<string> tableNames = null)
Line 169: {
Line 170: Database objDatabase = (Database)DatabaseFactory.CreateDatabase();
Line 171: using (DbConnection objDbConn = objDatabase.CreateConnection())
Line 172: {
Here are the list of references I have added.
Microsoft.Practices.EnterpriseLibrary.Common.dll, Microsoft.Practices.EnterpriseLibrary.Data.dll
Microsoft.Practices.ServiceLocation.dll
Microsoft.Practices.Unity.dll
Microsoft.Practices.Unity.Interception.dll
Here is the app.config that I've created for the solution:
="1.0"="utf-8"
<configuration>
<configSections>
<section name="dataConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Data.Configuration.DatabaseSettings, Microsoft.Practices.EnterpriseLibrary.Data, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" requirePermission="true" />
</configSections>
<dataConfiguration defaultDatabase="ConnectionString" />
<connectionStrings>
<add name="ConnectionString" connectionString="Data Source=xxxxxx; Persist Security Info=True;Initial Catalog = xxxx;user id = xxxxx; password = xxxx"
providerName="System.Data.SqlClient" />
</connectionStrings>
</configuration>
Please let me know where I'm making mistake.