What is the C# equivalent to the sql server 2005 real type?
相关问题
- Sorting 3 numbers without branching [closed]
- sql execution latency when assign to a variable
- Graphics.DrawImage() - Throws out of memory except
- Why am I getting UnauthorizedAccessException on th
- 求获取指定qq 资料的方法
the answer is
Single
orfloat
. (depending on style.) this is like the difference betweenString
andstring
[source: ReSharper code suggestion "use type keyword" when usingSingle
. it suggested usingfloat
.Double can be used as the .NET Equivalent Datatype for Real Datatype of SQL Server
Double gets the exact value with out Rounding
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.
Its Equivalent is Single. Single is A floating point number within the range of -3.40E +38 through 3.40E +38.
Here is the latest from MSDN describes all SqlDbType and C# Equivalents
The answer is float. If you try to use double as the type in the code but your field type in the database is real it will errors out. I just tested this myself and confirmed it errors with double.
it is a Single
see here for more info on SQL Server to .Net DataTypes