[Mono-bugs] [Bug 500987] SqlCommand with DateTime parameter throws exception "Error converting data type varchar to datetime" (impacts NHibernate and Castle ActiveRecord)

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Fri May 15 12:17:49 EDT 2009


http://bugzilla.novell.com/show_bug.cgi?id=500987

User loic.nageleisen at gmail.com added comment
http://bugzilla.novell.com/show_bug.cgi?id=500987#c14





--- Comment #14 from Loic Nageleisen <loic.nageleisen at gmail.com>  2009-05-15 10:17:47 MDT ---
Since Tds70 inherits Tds (which I stupidly overlooked), base.Locale is of
course set in Tds.cs, and it is set initially to CultureInfo.InvariantCulture.
Then it is set in

            case TdsEnvPacketSubType.Locale :

to

            locale = new CultureInfo (lcid);


During my tests, it seems Mono receives an lcid which implies a CultureInfo,
but MSSQL expects another locale. Using "SET LANGUAGE Français" aligns one with
the other. The question is, which one is wrong at the beginning? If I just
start a failing query without setting language, MSSQL error message is in
french, therefore LANGUAGE is Français to begin with, and lcid is something
else, certainly 1033 (database is set to us_english). In my opinion this
behavior must be due to the fact that the database is run on a French XP,
because there is no single place where the database is set to French. This
mismatch is then the cause of the failure, because Mono doesn't cope with this
(yet).

-- 
Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the mono-bugs mailing list