Coupons issue


https://forum.kartris.com/Topic592.aspx
Print Topic | Close Window

By amscompanies - Wed 25 May 2011
Whenever I try to access the Coupon menu in the admin section I get an error, attached below is the errorlog: (V1.3000)

-----------------------------------------------------------------------------
>>     URL:http://www.thefootballarchives.com/store/Admin/_Coupons.aspx
>>     Page:
-----------------------------------------------------------------------------
>>     25/05/2011 01:17:08
>>     194.73.118.78
>>     DESCRIPTION:
System.InvalidCastException: Conversion from string "30/5/2009" to type 'Date' is not valid.
   at Microsoft.VisualBasic.CompilerServices.Conversions.ToDate(String Value)
   at Microsoft.VisualBasic.CompilerServices.Conversions.ToDate(Object Value)
   at ASP.usercontrols_back__coupons_ascx.__DataBinding__control8(Object sender, EventArgs e)
   at System.Web.UI.Control.OnDataBinding(EventArgs e)
   at System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding)
   at System.Web.UI.Control.DataBind()
   at System.Web.UI.Control.DataBindChildren()
   at System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding)
   at System.Web.UI.Control.DataBind()
   at System.Web.UI.Control.DataBindChildren()
   at System.Web.UI.Control.DataBind(Boolean raiseOnDataBinding)
   at System.Web.UI.Control.DataBind()
   at System.Web.UI.WebControls.GridView.CreateRow(Int32 rowIndex, Int32 dataSourceIndex, DataControlRowType rowType, DataControlRowState rowState, Boolean dataBind, Object dataItem, DataControlField[] fields, TableRowCollection rows, PagedDataSource pagedDataSource)
   at System.Web.UI.WebControls.GridView.CreateChildControls(IEnumerable dataSource, Boolean dataBinding)
   at System.Web.UI.WebControls.CompositeDataBoundControl.PerformDataBinding(IEnumerable data)
   at System.Web.UI.WebControls.GridView.PerformDataBinding(IEnumerable data)
   at System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable data)
   at System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback)
   at System.Web.UI.WebControls.DataBoundControl.PerformSelect()
   at System.Web.UI.WebControls.BaseDataBoundControl.DataBind()
   at System.Web.UI.WebControls.GridView.DataBind()
   at UserControls_Back_KartrisCoupons.LoadCouponsGroups()
   at UserControls_Back_KartrisCoupons.Page_Load(Object sender, EventArgs e)
   at System.Web.UI.Control.OnLoad(EventArgs e)
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Control.LoadRecursive()
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

==================================================


Think the issue is caused by the date formatting of the two pre-defined coupons when creating the DB
By amscompanies - Wed 25 May 2011
So I've confirmed my theory by amending the start dates of the two default coupons and now the page loads OK.

I guess I can't be the first person to have this issue ?

This leads me onto a follow-up question, why do all the tables have triggers against them, is there a code reason, security reason ?

As I have had to remove it just to update the table
By Paul - Wed 25 May 2011
I have confirmed the error - seems to be the format of the date returned from the DAL/BLL. Looking into it now...