Why is a SQL float different from a C# float

后端 未结 6 618
清酒与你
清酒与你 2020-11-30 11:59

Howdy, I have a DataRow pulled out of a DataTable from a DataSet. I am accessing a column that is defined in SQL as a float datatype. I am trying to assign that value to

6条回答
  •  北荒
    北荒 (楼主)
    2020-11-30 12:59

    And normally you would never want to use float in SQL Server (or real) if you plan to perform math calculations on the data as it is an inexact datatype and it will introduce calculation errors. Use a decimal datatype instead if you need precision.

提交回复
热议问题