Sql server real datatype, what is the C# equivalent?

Viewed 48847

What is the C# equivalent to the sql server 2005 real type?

7 Answers

it is a Single

see here for more info on SQL Server to .Net DataTypes

Single is not the correct answer as it rounds the decimal part.. For instance 2.0799999 will be converted to 2.08. If there are no constraints regarding the rounding then it should be good.

Double can be used as the .NET Equivalent Datatype for Real Datatype of SQL Server

Double gets the exact value with out Rounding

the answer is Single or float. (depending on style.) this is like the difference between String and string [source: ReSharper code suggestion "use type keyword" when using Single. it suggested using float.

Related