开发者

SQL decimal equivalent in .NET

开发者 https://www.devze.com 2023-04-10 22:50 出处:网络
What is the SQL (MS SQL Serve开发者_如何学Gor) Decimal equivalent in .NET? Should it be Double, Decimal or Float (Single in VB.NET)?There\'s no exact equivalent type in .NET, as SQL\'s decimal type

What is the SQL (MS SQL Serve开发者_如何学Gor) Decimal equivalent in .NET?

Should it be Double, Decimal or Float (Single in VB.NET)?


There's no exact equivalent type in .NET, as SQL's decimal type is fixed point, whereas .NET's System.Decimal type is a floating (decimal) point type.

However, System.Decimal is definitely the closest match, and should generally be what's used to represent the value stored in a decimal column in a SQL database.


Use Decimal, as can be seen in this table.

0

精彩评论

暂无评论...
验证码 换一张
取 消