Failed to convert the date and / or time from a string

0

My app was working just fine for two months when it suddenly started printing this error. It doesn't tell in which page or where exactly it is I just get this:

  Erreur du serveur dans l'application '/'.
  Echec de la conversion de la date et/ou de l'heure à partir d'une chaîne de             caractères.

and this is the stack trace I have absolutely no idea where to start looking.

          [SqlException (0x80131904): Échec de la conversion de la date et/ou de l'heure à partir d'une chaîne de caractères.]
  System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction) +2418094
  System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception,   Boolean breakConnection, Action`1 wrapCloseInAction) +5694436
  System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose) +285
  System.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady) +3731
  System.Data.SqlClient.SqlDataReader.TryHasMoreRows(Boolean& moreRows) +240
  System.Data.SqlClient.SqlDataReader.TryReadInternal(Boolean setTimeout, Boolean& more) +268
  System.Data.SqlClient.SqlDataReader.Read() +34
  System.Data.Common.DataAdapter.FillLoadDataRow(SchemaMapping mapping) +211
  System.Data.Common.DataAdapter.FillFromReader(DataSet dataset, DataTable datatable, String srcTable, DataReaderContainer dataReader, Int32 startRecord, Int32 maxRecords, DataColumn parentChapterColumn, Object parentChapterValue) +197
  System.Data.Common.DataAdapter.Fill(DataSet dataSet, String srcTable, IDataReader dataReader, Int32 startRecord, Int32 maxRecords) +410
  System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +218
  System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior) +136
  System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable) +86
   System.Web.UI.WebControls.SqlDataSourceView.ExecuteSelect(DataSourceSelectArgume nts arguments) +1494
  System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments,    DataSourceViewSelectCallback callback) +22
  System.Web.UI.WebControls.DataBoundControl.PerformSelect() +149
  System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +74
  System.Web.UI.WebControls.GridView.DataBind() +9
  System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +114
  System.Web.UI.WebControls.CompositeDataBoundControl.CreateChildControls() +75
  System.Web.UI.Control.EnsureChildControls() +92
  System.Web.UI.Control.PreRenderRecursiveInternal() +42
  System.Web.UI.Control.PreRenderRecursiveInternal() +160
  System.Web.UI.Control.PreRenderRecursiveInternal() +160
  System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint,  Boolean includeStagesAfterAsyncPoint) +883
asp.net
sql-server
asked on Stack Overflow Dec 22, 2015 by Oussema Oz • edited Apr 30, 2021 by Jason Aller

1 Answer

0

use Globalization in your web.config file set culture and UI culture.

See full Documentation Here.

https://msdn.microsoft.com/en-us/library/bz9tc508.aspx

answered on Stack Overflow Dec 23, 2015 by Sudhir Panda

User contributions licensed under CC BY-SA 3.0