Last post Sep 14, 2017 09:21 AM by Cathy Zou
Sep 13, 2017 02:28 AM|Ravindranath M|LINK
I am having real datatype in Sql and when generated edmx the datatype is decimal for that column and when i enter the value like 12.3 its saving in DB as 12.xxxxxxxx. How to store exactly what user enters. The issue is while assigning to edmx datatype only.
Sep 13, 2017 07:57 AM|PatriceSc|LINK
A database is just storing values and doesn't care about formatting. It just happens that values are always *shown* according to some convention. For decimal columns, SQL Server Management Studio shows all decimal places (ie you likely have something such
Your web app should show the value without non significant 0 digits (ie 12.3 assuming your web app is configured for a country which uses . rather than some other symbol for the decimal point).
In short you have to make the difference between the actual value (ie 12.3 is 12.3 every on earth) and how it is shown (12.3 12,3 12.30000 is just 3 ways to show the same value depending on which convention is used).
Sep 13, 2017 08:16 AM|navneetmitawa|LINK
How to store exactly what user enters.
If you want to enter exactly as user enter then you can used varchar instead of real, but when you getting back you must need conversion varchar to double/float.
Sep 14, 2017 09:21 AM|Cathy Zou|LINK
Hi Ravindranath M,
From your description, you have real datatype in Sql but when generated edmx, the datatype is decimal.
However, I test it and when generated edmx, the datatype is float.
The output as below:
I suggest that you could set the datatype as float in sql dataase to store what user enters.
For more detail, you could refer to the following link: