SYMPTOMS
When using Sql Server database and the SmartDataSource Select command contains parameters
which are implicitly cast to money type the following error appears when trying
to extract the data:
"Disallowed implicit conversion from data type nvarchar to data type money. Use
the CONVERT function to run this query."
Setting the parameter's type to Decimal solves the problem in runtime but the problem
remains at design time.
CAUSE
In design time SmartDataSource ignores the specified parameter type and always sets
the command parameters' type to be the default one - DbType.String.
RESOLUTION
The problem has been fixed in smartDBforms.NET 1.5 and later. The select parameters'
type is properly propagated to the select command in design time. Setting the parameter's
type to Decimal fixes the problem in design time and runtime.
WORKAROUND
In order to fix the problem in design time, use the CONVERT function in the select
statement to explicitly convert the database parameter to money.
APPLIES TO
smartDBforms.NET 1.4 and previous versions when used with MS Sql Server database.