I am using Enterprise Library 4.1.
While I am executing the code by using :
using ( _db = DatabaseFactory.CreateDatabase("NLayerDB") )
{
DbCommand dbCommand = _db.GetStoredProcCommand("someSPName");
_db.AddInParameter(dbCommand, "Id", DbType.Int32, id);
result= _db.ExecuteNonQuery(dbCommand);
}
I am receiving the following error :
Microsoft.Practices.EnterpriseLibrary.Data.Database type used in a using statement must be implicitly convertible to 'System.IDisposable'
What is the exact problem of having USING statement here ?