Where can I find "DBCommandWrapper" RRS feed

  • Question

  • User593747808 posted

    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.Sq

    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.

    Thursday, December 25, 2008 4:18 AM

All replies

  • User3011751 posted

    There is no DBCommandWrapper in Enterprise Library 4.1.
    You can use the DbCommand class which is generated with the GetStoredProcCommand method to work with commands in ent-lib 4.1.
    The DbCommand is located in the System.Data.Common namespace.

    Thursday, December 25, 2008 7:30 AM
  • User-1621240137 posted

    and I am trying to use DBCommandWrapper but I can't find it


    It existed in previous versions of EntLib. If you are working with OleDb data provider you can take a look at ADO.NET Accelerator. It has a DbManager class that actually works as the command wrapper.

    1    OrderedDictionary paramValues = new OrderedDictionary();
    2 paramValues.Add("par_id", this.tb_user_id.Text);
    3 IDataReader reader = SqlNetFramework.Management.DbManager.Instance.ExecuteReader(0, "YourConnectionId", paramValues);

    If you use the OleDb data provider to connect to your database then you can use ADO.NET Accelerator for FREE.

    Luis Ramirez.

    Monday, January 5, 2009 10:45 PM