subsonic / SubSonic-2.0

SubSonic 2.0 Home
http://subsonic.github.io/
Other
80 stars 45 forks source link

Update Fails when using SetExpression #3

Closed BlackMael closed 12 years ago

BlackMael commented 15 years ago

Steps: Create a SubSonic.Update query Add a .SetExpression(SomeDecimalColumn).EqualTo("OtherDecimalColumnName") Call Execute() on the Update query

Result: Error occurs stating unable to convert String to decimal.

Reason: Execute method in Update.cs does not check each Setting in SetStatements collection for IsExpression == true. Attempts to add Setting object as a parameter to the cmd object with type decimal.

Resolution: Only add setting parameter if s.IsExpression == false as the expression is already embedde into the built SQL query.

Note: I have this fixed in my fork, just as soon as I check it in.