c# - Float type field in Model while automatically created in database as real type? -


iam using mvc4 .i have model .in model created field called "allfuels" of data type float. when table automatically created in database data type of field "allfuels" real.iam using model first method .can know reason why happening?

public float allfuels { get; set; } 

but field in table created real datatype.

... why happening?

well, that's easy - because mapping programmed ef.

does matter?

look @ following:

so "approximate range" same both, storage amount: both 32-bit floating binary point types. annoying thing .net float not mentioned in bol reference data type conversion, makes hard .

in addition, edm.float listed in edm data types (msdn: conceptual model types (csdl)) floating point 7-digit precision, matches float in .net , real in sql server (csdl xml language describes entites, relationships etc. , used ef).

so should do?

what microsoft floating point in ado.net? if read: msdn - data type mappings in ado.net (floating-point numbers) "test". that, , if precision not enough you, .net type needs double instead, should become higher precision type in sql server (it translate float(53), believe)


i couldn't find ieee reference, point @ wikipedia definition of "approximate range".

edit guru lasse v. karlsen totally right ask me qualify statement: single equivalent float, badly expressed point have know single rather float able find information in reference.


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

CSS3 Transition to highlight new elements created in JQuery -