I am using Enterprise Library 4.1(October 2008)
and I am trying to use DBCommandWrapper but I can't find it
I had added the following references:

Imports System.Data
Imports Microsoft.Practices.EnterpriseLibrary.Data
Imports Microsoft.Practices.EnterpriseLibrary.Data.Sql

I wrote the following code:

Dim db As Database = DatabaseFactory.CreateDatabase()
Dim objDBCommandWrapper As DBCommandWrapper = db.GetStoredProcCommandWrapper(sqlCommand)

but when I compile the code, the following error comes up:
Type "DBCommandWrapper" is not defined.

I want help to solve this error.

Thanks in advance.

Recommended Answers

Use System.Data.Common.DbCommand instead.

Jump to Post

All 2 Replies

Use System.Data.Common.DbCommand instead.

dbCommandWrapper is deprecated, that was from Enterprise Library 1.1, now it is a full object EL 2.0+), use dbCommand (found in Using System.Data.Common; or Imports System.Data.Common for vb.net!)

commented: You resurrected a two-year-old post just to repeat what was already answered. -3
Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.19 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.