DBCommandWrapper or DBCommand enterprise lib 4.1

Topics: Data Access Application Block
May 7, 2010 at 6:11 PM

using Microsoft.Practices.EnterpriseLibrary.ExceptionHandling;

using Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging;

using Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Configuration;

using Microsoft.Practices.EnterpriseLibrary.Common;using Microsoft.Practices.EnterpriseLibrary.Data;

using Microsoft.Practices.EnterpriseLibrary.Data.Sql;using Microsoft.Practices.EnterpriseLibrary.Data.Configuration;

 Database db = DatabaseFactory.CreateDatabase();    

 DBCommand cmd = db.GetSqlStringCommand(sql);            or   DBCommandWrapper cmd = db.GetSqlStringCommand(sql);    //Eiter of the lines give me same error... which namespace am i missing???

Error 1 The type or namespace name 'DBCommand' could not be found (are you missing a using directive or an assembly reference?) ....

Need a response quickly... pls



May 7, 2010 at 7:12 PM


Feb 11, 2011 at 11:53 PM

how did u solve this, i am getting the same error.


Feb 14, 2011 at 12:48 AM

Note that the DbCommandWrapper has already been deprecated in version 2.0.

If you're not using the DbCommandWrapper and is currently getting the compile error, you might be targeting the .NET Framework 4.0 Client Profile.  This won't work and you need to target the full .NET Framework 4.0.  This has already been logged in the Issue Tracker.


Sarah Urmeneta
Global Technologies and Solutions
Avanade, Inc.