subsonic / SubSonic-2.0

SubSonic 2.0 Home
http://subsonic.github.io/
Other
80 stars 45 forks source link

Parameters assigned by InlineQuery are always of type DbType.AnsiString #13

Open holzbrenner opened 14 years ago

holzbrenner commented 14 years ago

When InlineQuery adds parameters to its command, it always sets their database type to DbType.AnsiString. This probably works in many cases, as these strings are implicitly converted to appropriate data type, but it's dependent on regional settings of Windows and database server (in my case MS SQL Server) for some data types like DateTime, Currency etc. I noticed problems on some developer machines; InlineQuery failed with error message from the server which was unable to convert AnsiString to e.g. DateTime. Perhaps database server was running on a machine with different regional settings than client machine with .NET 2.0 application using SubSonic.

I created a small fix for version 2.2.1.0 to resolve this issue, here is a patch file which can be applied from root: http://freeweb.t-2.net/gundakar/subsonic_dbtype_patch.patch

If SubSonic 2.x is still supported at all, maybe somebody with more knowledge of the library can take a look at my fix as a starting point and do a proper solution for this issue.