>SELECT CAST( '123.45' AS INT) -- GENERATES AN ERROR>
>SELECT CAST( ROUND('123.45',0) AS INT) -- GENERATES 123The original problem is because he used AddWithValue and the parameter was send as varchar. If he would use Add and exact type, this would not happen.
SELECT CAST( 123.45 AS INT)