Inconsistent error message RRS feed

  • Question

  •  Hi Everyone I'm getting the following error message but nothing is consistent. I can get the message one 1 machine on our network all running the same software version and data but not on the rest. Could this be a setting in windows or SQl to cause this ?

    SQL Server Exception: Conversion failed when converting datetime from character string.(241) ---> System.Data.SqlClient.SqlException: Conversion failed when converting datetime from character string.
       at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
       at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
       at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
       at System.Data.SqlClient.SqlDataReader.HasMoreRows()
       at System.Data.SqlClient.SqlDataReader.ReadInternal(Boolean setTimeout)
       at MLS.General.Server.MSSQL2000.PageView_ReadRow(PageView PageView, IBaseRow Row)
       --- End of inner exception stack trace ---
       at MLS.WBLS.Schedules.SystemMaintenanceFull.DoWork(String Configuration, Byte[] Data)
       at MLS.Scheduler.Job.Execute()

    Thank you in advance for any help offered.

    Thursday, January 22, 2009 3:26 PM

All replies

  • See if the following thread helps. I would suspect that there is a bad date format but I can't determine how you are defining them in your Command Parameters.


    Paul ~~~~ Microsoft MVP (Visual Basic)
    Tuesday, January 27, 2009 2:40 PM
  • Do you have same regional settings on all computers? Can you check how you post date values to you SQL statements? If you concatenating date values building dynamic SQL then most likely this is the source of the issue, because date value will have different representation depending on regional settings of computer where application runs. To avoid this issue you would need to pass values as parameters to your SQL statements
    Val Mazur (MVP)
    Friday, January 30, 2009 11:31 AM