Ok I fixed the problem again by myself after reviewing th e Database I spelled something wrong I put "PATCatecoryID" Instead of "PATCaregoryID" Silly me!
Now the million dollar prize! When I got to add an Item to the shopping cart I get this error.
Server Error in '/' Application.
--------------------------------------------------------------------------------
Specified cast is not valid.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidCastException: Specified cast is not valid.
Source Error:
Line 246: oi.ItemDescription = currentRow["Code_NumDescription"].ToString();
Line 247: oi.Quantity = (int)currentRow["Quantity"];
Line 248: oi.CODE_NUM = (string)currentRow["CODE_NUM"];
Line 249: oi.Special = false;
Line 250: currentOrder.OrderItems.Add( oi );
Source File: c:\inetpub\wwwroot\wineshopny\wineshopny\shoppingc art.aspx.cs Line: 248
Stack Trace:
[InvalidCastException: Specified cast is not valid.]
WS.Web.ShoppingCartPage.RenderAndSum(DataRowView currentRow) in c:\inetpub\wwwroot\wineshopny\wineshopny\shoppingc art.aspx.cs:248
ASP.ShoppingCart_aspx.__DataBind__control25(Object sender, EventArgs e) in C:\Inetpub\wwwroot\wineshopny\wineshopny\ShoppingC art.aspx:122
System.Web.UI.Control.OnDataBinding(EventArgs e) +66
System.Web.UI.Control.DataBind() +26
System.Web.UI.Control.DataBind() +86
System.Web.UI.Control.DataBind() +86
System.Web.UI.WebControls.DataGrid.CreateItem(Int3 2 itemIndex, Int32 dataSourceIndex, ListItemType itemType, Boolean dataBind, Object dataItem, DataGridColumn[] columns, TableRowCollection rows, PagedDataSource pagedDataSource) +169
System.Web.UI.WebControls.DataGrid.CreateControlHi erarchy(Boolean useDataSource) +1403
System.Web.UI.WebControls.BaseDataList.OnDataBindi ng(EventArgs e) +48
System.Web.UI.WebControls.BaseDataList.DataBind() +23
WS.Web.ShoppingCartPage.LoadData() in c:\inetpub\wwwroot\wineshopny\wineshopny\shoppingc art.aspx.cs:121
WS.Web.ShoppingCartPage.Page_Load(Object sender, EventArgs e) in c:\inetpub\wwwroot\wineshopny\wineshopny\shoppingc art.aspx.cs:75
System.Web.UI.Control.OnLoad(EventArgs e) +67
System.Web.UI.Control.LoadRecursive() +35
System.Web.UI.Page.ProcessRequestMain() +714
What does invalid cast member mean?
Brett G. Murphy
|