are you using strings injection instead parameters ? 2009/5/28 Mark Nijhof <[email protected]>
> > Hi Fabio, > > I was asking for my college, he is having the following specific issue > (and I was worried because we will be in the same situation): > > -- > We currently use SQL Server 2005 with collation Danish_Norwegian_CI_AS > and the web server executing queries has its regional date settings > set to dd.MM.yyyy. The dates that appear in sql generated by > NHibernate becomes: '27.04.2009 15:06:21' (27th of April 2009), which > correspond to the regional date settings and should also correspond to > the SQL collation. This however result in the following sql exception: > "The conversion of a char data type to a datetime data type resulted > in an out-of-range datetime value." > > This is a sql issue, but related to this I have two questions: > 1) Is NHibernate suppose to take regional settings into account and > not use invariant (DateTime.ToString() .vs. > DateTime.ToString(CultureInfo.InvariantCulture)) or use ISO > (yyyy-MM-dd)? > 2) What is the recommended solution to culture settings in NHibernate, > specifically related to dates? Can we control them? > > > Thanks, > > -Mark > > > > On Thu, May 28, 2009 at 5:41 PM, Fabio Maulo <[email protected]> wrote: > > And which is the problem ? > > That is a normal environment. > > > > 2009/5/28 Mark Nijhof <[email protected]> > >> > >> Hi, > >> > >> Cross posted to both NHibernate and Fluent NHibernate as I don't know > >> where this should be done. > >> > >> Is there a way specify the culture settings to be used by NHibernate > >> without relying on the culture settings of the windows machine? > >> Because the database may not have the same culture settings as the > >> clients have, internally I want to always use the same settings > >> because that is how I know the DB is setup. > >> > >> -Mark > >> > >> > > > > > > > > -- > > Fabio Maulo > > > > > > > > > > > -- Fabio Maulo --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "nhusers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/nhusers?hl=en -~----------~----~----~----~------~----~------~--~---
