What Changed
In v24.2, we supported DateOnly
and TimeOnly
.NET types for the following XPO database providers:
- MSSQL
- PostgreSQL
- Oracle
- MySql
- Firebird
- SQLite
Previously, columns of tables that had the date
and time
SQL types were mapped to the DateTime
.NET type by default.
Reasons for Change
XPO is used in SqlDataSource
- the most popular data source in Reports and Dashboards. We enhanced its functionality by supporting DateOnly
and TimeOnly
properties.
Impact on Existing Apps
If your code has persistent classes with persistent properties mapped to table columns with SQL types date
or time
, you may get type conversion errors when storing and loading the data.
If your code uses the GetStorageTables()
or GetTableSchema()
methods to get the data tables schema, then the columns with the SQL types date
and time
are mapped to DBColumnType.DateOnly
and DBColumnType.TimeOnly
instead of DBColumnType.DateTime
.
How to Revert to Previous Behavior
Add the following line of code before you execute data operations to revert mapping of date
and time
SQL types to the DateTime
.NET type:
ConnectionProviderSql.GlobalUseLegacyDateOnlyAndTimeOnlySupport = true;