Hi. Thanks to one Microsoft's team we have to implement another drive for MsSqlServer http://connect.microsoft.com/VisualStudio/feedback/details/381934/sqlparameter-dbtype-dbtype-time-sets-the-parameter-to-sqldbtype-datetime-instead-of-sqldbtype-time
<http://connect.microsoft.com/VisualStudio/feedback/details/381934/sqlparameter-dbtype-dbtype-time-sets-the-parameter-to-sqldbtype-datetime-instead-of-sqldbtype-time>Our two related issues are NH-2660 and NH-2661. The user is using our "nice" TimeType (I have used with others RDBMS and it work fine); in practice those DataProviders work with DateTime normally and they take care about the possible conversion from DateTime when the parameter type is DbType.Time. Now... For Sql2000 and Sql2005 the DbType.Time expect a DateTime so, our dear TimeType, work as expected. Even for Sql2008 our TimeType work well, at least to store and read values but when we have to run a query, with a value comparison in the where clause, the DataProvider/Sql2008 is not so intelligent and we have a wonderful ADO.NET exception. Because seems that we are the "workaround fabric" we have to find a solution. In practice we have to implement a SqlClient2008Driver where: 1) when the DbType is DbType.Time we have to cast the parameter to SqlParameter and set it to SqlDbType.Time 2) the value of the parameter have to be converted to a TimeSpan In theory it should be not a big problem because we have special drivers for other RDBMS versions... In theory it should be not a big problem because we have can set the default driver in the MsSql2008Dialect... In practice: can you imagine how many users already have the NH configuration with the explicit set of NHibernate.Driver.SqlClientDriver and the MsSql2008Dialect ? "Che famo ?", "de que nos disfrazamos ?" Thoughts ? -- Fabio Maulo
