Strange SqlDateTime overflows occurs Linq SubmitChanges()
Hi,
I am running out of ideas to locate source or how to replicate error in local pc what is happens 9 times in live site. We are logging errors occurred in the site, and for 9 times it has this error "sqldatetime overflow", strange is only occurs 9 times and not always, tested it in local pc and dev server, this error don't and never occurred...I checked the codes, twice in the codes CrDate (Not Nullable) is being set to DateTime.Now during insert/add process and ModDate (Nullable) is being also to DateTime.Now during update/edit process... In table structure, CrDate is set wth default to getdate() and ModDate allows null and no default value...
So why these errors occurs? How can I replicate errors or explanation as to why this happens and how to fixed it? Would setting Auto Generate Values property for CrDate to true would definitely prevent re-occurrence of this error???
Recorded/Logged Error:
at System.Data.SqlTypes.SqlDateTime.FromTimeSpan(Time Span value) at System.Data.SqlTypes.SqlDateTime.FromDateTime(Date Time value) at System.Data.SqlClient.MetaType.FromDateTime(DateTi me dateTime, Byte cb) at System.Data.SqlClient.TdsParser.WriteValue(Object value, MetaType type, Byte scale, Int32 actualLength, Int32 encodingByteSize, Int32 offset, TdsParserStateObject stateObj) at System.Data.SqlClient.TdsParser.TdsExecuteRPC(_Sql RPC[] rpcArray, Int32 timeout, Boolean inSchema, SqlNotificationRequest notificationRequest, TdsParserStateObject stateObj, Boolean isCommandProc) at System.Data.SqlClient.SqlCommand.RunExecuteReaderT ds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) at System.Data.SqlClient.SqlCommand.RunExecuteReader( CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) at System.Data.SqlClient.SqlCommand.RunExecuteReader( CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) at System.Data.SqlClient.SqlCommand.ExecuteReader(Com mandBehavior behavior, String method) at System.Data.SqlClient.SqlCommand.ExecuteDbDataRead er(CommandBehavior behavior) at System.Data.Common.DbCommand.ExecuteReader() at System.Data.Linq.SqlClient.SqlProvider.Execute(Exp ression query, QueryInfo queryInfo, IObjectReaderFactory factory, Object[] parentArgs, Object[] userArgs, ICompiledSubQuery[] subQueries, Object lastResult) at System.Data.Linq.SqlClient.SqlProvider.ExecuteAll( Expression query, QueryInfo[] queryInfos, IObjectReaderFactory factory, Object[] userArguments, ICompiledSubQuery[] subQueries) at System.Data.Linq.SqlClient.SqlProvider.System.Data .Linq.Provider.IProvider.Execute(Expression query) at System.Data.Linq.ChangeDirector.StandardChangeDire ctor.DynamicInsert(TrackedObject item) at System.Data.Linq.ChangeDirector.StandardChangeDire ctor.Insert(TrackedObject item) at System.Data.Linq.ChangeProcessor.SubmitChanges(Con flictMode failureMode) at System.Data.Linq.DataContext.SubmitChanges(Conflic tMode failureMode) at System.Data.Linq.DataContext.SubmitChanges() at CoreLib.Services.KRAService.Save(Int32 kraCategoryId, Int32 employeeSBUId, List`1 KRAs, KRAStatus status) in E:\[Omitted]\CoreLib\Services\KRAService.cs:line 156 at [Omitted].Save(Int32 categoryId, Int32 employeeSBUId, List`1 KRAs, Boolean redirect, KRAStatus status) in E:\[Omitted]\changenameclass.cs:line 276 at [Omitted].Views.DefaultViewPresenter.SaveData(Int32 categoryId, Int32 employeeSBUId, DataTable dt, Boolean redirect, KRAStatus status) in E:\[Omitted]\DefaultViewPresenter.cs:line 852 at [Omitted].SaveAllKRAs(Object sender, EventArgs e, Boolean redirect) in E:\[Omitted]\WebSites\[Omitted]\Default.aspx.cs:line 501 at [Omitted].Save(Object sender, EventArgs e) in E:\[Omitted]\WebSites\[Omitted]\Default.aspx.cs:line 242 at [Omitted].Shell.MasterPages.DefaultMaster.MainMenu_Click(Ob ject sender, EventArgs e) in E:\[Omitted]\WebSites\[Omitted]\Shared\DefaultMaster.master.cs:line 298 at System.Web.UI.WebControls.LinkButton.OnClick(Event Args e) at System.Web.UI.WebControls.LinkButton.RaisePostBack Event(String eventArgument) at System.Web.UI.WebControls.LinkButton.System.Web.UI .IPostBackEventHandler.RaisePostBackEvent(String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler sourceControl, String eventArgument) at System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
|