Reputation: 32490
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
Upvotes: 3
Views: 8259
Reputation: 2746
Just initialize the Parameter with a new SqlMoney(decimal)
constructor.
SqlParameter parameter = new SqlParameter("@Money", SqlDbType.Money);
See the SQLMoney Constructor documentation.
Upvotes: 4
Reputation: 13313
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.
Upvotes: 1