Search code examples
asp.netentity-framework-4asp.net-dynamic-data

Dynamic Data Entity Framework missing Decimal Column


I'm trying to build a Dynamic Data website to act as a simple admin interface to a MySQL database.

This isn't my area of expertise - but it all looks pretty straightforward when following the microsoft website. However for some reason when using the Entity Data Model to the project, the edmx model is created, but doesn't read one of the tables correctly.

In the MySQL database I have a large table containing 9 columns. The first column is the primary key and is an INT. The remaining columns are of type Decimal with a length of 6,2.

The edmx file shows the INT column - but fails to read any of the Decimal columns. If I change these to VARCHAR columns - everything is read perfectly?

The Dynamic Data Field Templates contains a control for decimals and surely the entity framework must be able to recognize columns of DECIMAL type - so I must be doing something wrong - I just can't work out what!

Any help much appreciated! Cheers Darren


Solution

  • Ok -I discovered the answer myself! The issue was due to using unsigned decimal values in the table structure.

    Dynamic Data / Entity frame work does not recognise the decimal data type if the column is marked as unsigned. When I changed this, the entity framework was able to read the DB structure correctly!

    Hope this helps anyone else who comes across the same issue!

    Cheers Darren