المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Entlib + config problem



C# Programming
08-21-2009, 12:47 PM
Hello All,

I've got a problem with EntLib 4.1 in combination with my config file.

I have a class library for data access which has its own app.config file containing the information for the sql connection.
</span span class="code-SummaryComment"version/spanspan class="code-keyword"="/spanspan class="code-keyword"1.0"/span span class="code-SummaryComment"encoding/spanspan class="code-keyword"="/spanspan class="code-keyword"utf-8"/spanspan class="code-SummaryComment"?/spanspan class="code-SummaryComment">










Code to access the database:
public static DataSet SelectAll()
{
DataSet retValue = new DataSet();

try
{
Database db = DatabaseFactory.CreateDatabase();
DbCommand cmd = db.GetStoredProcCommand(stpTest);
retValue = db.ExecuteDataSet(cmd);
}
catch (Exception ex)
{
throw ex;
}

return retValue;
}

With this go the following includes:
using System.Data;
using Microsoft.Practices.EnterpriseLibrary.Data.Sql;
using Microsoft.Practices.EnterpriseLibrary.Data;
using System.Data.Common;


What am i doing wrong, i'm getting the following error on the CreateDatabase() line:

{"The current build operation (build key Build Key[Microsoft.Practices.EnterpriseLibrary.Data.Database, null]) failed: The value can not be null or an empty string. (Strategy type ConfiguredObjectStrategy, index 2)"}