Current filter:
                                You should refresh the page.
                                  • Hello,

                                    my XpObject has a property of type "decimal" .

                                    [C#]
                                    public decimal? Percentage

                                    Just like expected - XPO creates a column of type "currency" for a property of type "decimal" in the MS Access database (.mdb).

                                    After decorating the property with the DbTypeAttribute

                                    [C#]
                                    [DbType("double")]

                                    XPO creates a column of type "double". So far so good but...

                                    After activating XPO logging in my app.config

                                    [XML]
                                    <system.diagnostics> <switches> <add name="XPO" value="3" /> </switches> </system.diagnostics>

                                    there is still a parameter in the sql query of the type "currency".

                                    [SQL]
                                    Executing sql 'parameters (...),[@p3] currency, (...) {0,1234567}....

                                    Is this a bug?

                                    The above conversion reduces the precision to 4 digits, which is not acceptable for me.
                                    I use the "decimal" type everywhere in my app and replacing it with double is no option.

                                    Thanks in advance for your help and the great product.

                                1 Solution

                                Creation Date Importance Sort by

                                Hello Pawel,

                                When creating a parameter string, XPO takes into account only the parameter value's type. The database type that is used for Decimal parameters is returned by the AccessConnectionProvider.GetSqlCreateColumnTypeForDecimal method. You can override this method to use another type for such parameters. See how to register a custom provider in the following article: How to create a custom XPO connection provider and then use it in an XAF application.

                                • Pawel Idzikowski 08.08.2019

                                  Hello Anatol,

                                  following your suggestion I have implemented a custom AccessConnectionProvider and it works as expected. Thank you for the prompt help.

                                • Anatol (DevExpress Support) 08.08.2019

                                  You are welcome!