Hi list,

Little database language settings problem

Got one database in us one in uk, each with the regional settings

When inputting dates I've set my application to use the Us date format :
Month Day Year

When executing the following code,

SET DATEFORMAT mdy; GO

Update WsF_Core_Elements set [EMAIL PROTECTED], [EMAIL PROTECTED],
[EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED] where
ElementId = 370;

With param values:
@ValidFrom  = "03/22/2004"
@ValidTo    = "04/22/2005"


which was generated dynamically, the param values are set and added to
the command object as the string is created, I can see that the values
are in the correct format when they have been passed into the date
Fields, valid to and valid from. But the server errors with: input
string is not in the correct format.

Im thinking that its got something to do with the fact that the params
are being assigned before the SET DATEFORMAT mdy gets executed and the
format is set?? But I'm not too up on ADO, has anyone ever come across
this before???

adding the params at a later stage would involve too much work to
refactor in, is there anything else I can do ??

Error:
System.Web.Services.Protocols.SoapException: Server was unable to
process request. ---> System.FormatException: String was not recognized
as a valid DateTime.
   at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior
cmdBehavior, RunBehavior runBehavior, Boolean returnStream)
   at System.Data.SqlClient.SqlCommand.ExecuteNonQuery()
   at WsFramework.DataCore.Tumble_N_Bear.Elements.Product.update(Int32
elementId, XmlDocument data, UiStatus Client) in
c:\inetpub\wwwroot\tumblenbear.net\private\codebase\wsframework\datacore
\tumble_n_bear\elements\elements.cs:line 230

the soap bit at the start is because its using webservices to submit the
data

Any suggestions, comments ?

Alan

===================================
This list is hosted by DevelopMentor�  http://www.develop.com
You may be interested in Guerrilla .NET, 24 March 2003, in London and Boston
http://www.develop.com/courses/gdotnet

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to