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

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 developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.