DAAB 3.0 - Decimal out params.

May 16, 2007 at 6:44 AM

What’s the proper way to add a decimal out parameter and specify the scale and precision using the DAAB 3.0? I tried the following, but it returns “Decimal” in the parameter.value:

System.Data.SqlClient.SqlParameter tax = new System.Data.SqlClient.SqlParameter("@SalesTaxPercentage", DbType.Decimal);

tax.Direction = ParameterDirection.Output;
tax.Precision = 4;
tax.Scale = 2;

first I tried:

db.AddOutParameter(dbCommand, "@SalesTaxPercentage", DbType.Decimal, 0);

But it was rounding my decimal values. I also tried passing in various numbers for size.


May 17, 2007 at 12:09 AM
Question about the data access application block should be posted in the Enterprise Library forum http://www.codeplex.com/entlib/Thread/List.aspx