I don't know what that SQL.AddParam("@TaxRate3", Me.TaxRate3TB.Text
and SQL.ExecQuery
etc are. Some kind of homebrew?
In any case, I get the impression that it passes the parameters as nvarchar
, when it should pass them as decimal
/numeric
. And furthermore, the values as passed as 67,1213
rather than 67.1213
, which is the only format that SQL Server understands.
The normal way to set up parameters in .NET is
cmd.Parameters.Add("@par", SqlDbType.Numeric).Value = DiscountRateTB;
cmd.Parameters["@par"].Precision = 18;
cmd.Parameters["@par"].Scale = 5;
(This is C# rather than VB .NET, but the principle is the same in VB-