Help needed -- Enterprise Lib 3.1 -- System.Data.Common.DbCommand' does not contain a definition for 'AddOutParameter'

Topics: Building and extending application blocks, Data Access Application Block, Enterprise Library Core
Apr 3, 2008 at 7:39 AM
private void AppendParameters(List<SqlParameter> parameters, DbCommand cmd)
{
if (parameters != null)
{
foreach (DbParameter param in parameters)
{
if (param.Direction == ParameterDirection.Output)
{
cmd.AddOutParameter(param.ParameterName, param.DbType, param.Size);
}
else
{
cmd.AddParameter(param.ParameterName, param.DbType, param.Direction, param.SourceColumn, param.SourceVersion, param.Value);
}
}
}
}

While compiling, above code gives error System.Data.Common.DbCommand' does not contain a definition for 'AddOutParameter'. I am using Enterprise Lib 3.1
Apr 4, 2008 at 3:08 PM
Edited Apr 4, 2008 at 3:09 PM
AddOutParameter is a method on Database object, and not command object. So, use AddParameter and set the direction to output