Unable to use DBCommandWrapper in EntLib 5.0

Topics: Data Access Application Block, General discussion
May 15, 2010 at 11:39 AM

I am a new user to Enterprise library and i have been following some of tutorials online. Most of these tutorial referes to a DBCommandWrapper, however, weither i am using Vb.Net or C# I end up with the same problem "Undeclare Element" by the VS intellisense. I am using VS 2010 Professional.

Can anyone help me please, i am working on several projects that i want to include Blocks from the Enterprise Libary in.

 

 

Dim dbMLFsys As Database = DatabaseFactory.CreateDatabase()
Dim cmd As DBCommandWrapper = dbMLFsys.GetStoredProcCommand("pIsBlockedListed" )

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

May 17, 2010 at 2:06 AM

You're probably experiencing the issue on targeting .NET 4.0 Client Profile.  The Data Application Block will only work if you target the full .NET Framework.   Go to your project properties -> Application tab and select .NET Framework 4.0 in the Target Framework.

 

Sarah Urmeneta
Global Technology & Solutions
Avanade, Inc.
entlib.support@Avanade.com

May 17, 2010 at 6:44 PM
Edited May 17, 2010 at 6:45 PM

Thanks for your help AvanadeSupport, but I'd actually figured out what the problem was. In the tutorials on line there is a constant reference to a DbCommandWrapper that in fact, does not exist. The correct object is actually "DbCommand". For some reason many of the tutorials online have this error about them.

May 18, 2010 at 2:46 AM

Sorry, I didn't check what object you're using.  The DbCommandWrapper has been deprecated in version 2.0

 

Sarah Urmeneta
Global Technology & Solutions
Avanade, Inc.
entlib.support@Avanade.com