[Notes] climb pit how to read and write c # sql server is similar to double by EF Core type field

===============================================

 2019/8 / 31_ first edit              ccb_warlock          

 

===============================================

Used sql server people may find it strange that field type sql server did not double, why such a title?

Mainly through the c # in double data type when reading and writing stepped in sql server in the pit, which made this record.

 

 

When the most recent first write read EF Core sql server, wherein the attribute type is defined as a double in C #, sql server and a plug type field can be present only the following four kinds of fractional type:

decimal
float
numeric
real

 

Initially I granted that, you can choose to save double type decimal, the results of the query when prompted to format mismatch.

 

EF Core is not supported when reading and writing sql server will turn into a double to decimal display (in fact, think also, decimal precision is higher than double, from decimal to double data loss will occur, of course, to frame error).

 

Check the information after that, Float sqlserver data table corresponds Double, in other words, if double or float type attribute defines the internal C #, can be mapped to a float field in sql server.

(Oracle provided number, mysql respectively provide a float, double, so a comparison sql server of this design is not a pit?)

 


References:

1.https://bbs.csdn.net/topics/60228284

2.https://blog.csdn.net/qq_27376871/article/details/51321175

3. https://www.cnblogs.com/ShaYeBlog/p/8287587.html

4. https://www.cnblogs.com/yachao1120/p/7879532.html

 

Guess you like

Origin www.cnblogs.com/straycats/p/11441127.html