I have a SQL Server SPROC that takes a money paramater.
I'm passing in a C# decimal to this SPROC
How do I pass in the decimal from C# to the money type in the SPROC in such a way that I wont loose any values after the point
I have a SQL Server SPROC that takes a money paramater.
I'm passing in a C# decimal to this SPROC
How do I pass in the decimal from C# to the money type in the SPROC in such a way that I wont loose any values after the point
Just initialize the Parameter with a new SqlMoney(decimal)
constructor.
SqlParameter parameter = new SqlParameter("@Money", SqlDbType.Money);
See the SQLMoney Constructor documentation.
I'd try this : What is the best data type to use for money in c#?
Or you can look into the .Parse
overrides. I know theres a lot of format and currency is one of them.