Page 1 of 1

New Database Table Pattern

Posted: Mon Jun 17, 2013 2:38 am
by jackcraig66
I am currently studying the New Database Table Pattern - is there any general guidance for cases where a table needs a currency-related column? Is it OK to use the decimal type? Looking at various OpenDentBusiness TableTypes it seems double is used where an amount in money is to be stored.

I have only just started looking at this so will reply to my own post if I find anything ...but I'm interested if anyone has suggestions of what to look at or consider...

Thanks!

(see: http://www.opendental.com/manual/patter ... table.html)

Re: New Database Table Pattern

Posted: Mon Jun 17, 2013 8:51 am
by jackcraig66
...found that the Crud Generator doesn't support the decimal type - see extract from exception below

Code: Select all

System.ApplicationException was unhandled
  ...
  Message=Type not yet supported: Decimal
  ...
       at xCrudGenerator.Form1.WriteAll(StringBuilder strb, String className, Type typeClass, Boolean isMobile) in ...\xCrudGenerator\Form1.cs:line 265
       ...
  InnerException:

Re: New Database Table Pattern

Posted: Mon Jun 17, 2013 11:34 am
by jsalmon
As you found out, Decimal database types have not been implemented. There hasn't been a need, doubles have been sufficient. Is there are particular reason you are wanting to use decimal instead of double in the database?

Re: New Database Table Pattern

Posted: Tue Jun 18, 2013 1:51 am
by jackcraig66
I think the section towards the end of the Pattern about strings and ints made me think about any issues with other types...