Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post May 08, 2012 01:44 AM by Decker Dong - MSFT
May 06, 2012 05:40 PM|LINK
I have a field for storing laboratory results but i cannot decide which data-type i should chose. The most important thing for me is that i
do not want any automatic Decimal Conversion. I needto have the following “ what the user enter ,, is what it will be saved in the database and it will be what he see later”.
The laboratory results can varies in its format, such as:-
- - 30.56
So i cannot determine which datatype to use either ; decimal, float, double or even another data-type.
May 06, 2012 05:57 PM|LINK
Saving it as a string will make sure it will prevent any decimal conversions. Not sure if you use the number for any calculations so this may not work for you.
May 06, 2012 09:13 PM|LINK
Sorry i did not mention that i am using the Result field for some calculation such as comparing if the result are (within , less than or exceed a certain level) -where these levels might also have fractions- , so string will not work i think. Any suggestions
May 08, 2012 01:44 AM|LINK
do not want any automatic Decimal Conversion.
Then I think you should define your SQL type is money，and in C# it should be converted to decimal（See the mapping types between .NET and SQL db's type：http://msdn.microsoft.com/en-us/library/4e5xt97a(v=vs.71).aspx）
And what's more，you should show it to the public by using string.Format function。
Hope this helps！