Sorry again Every thing was going on well but all of a sudden I got a
wired reaction:
Why is it that when I insert data I fast get an error :
Specified cast is not valid.
But When I run the site for the second time I find the data was saved
the right image was selected! Actually I can say every thing works
well apart that when ever I attempt to insert data this error appears:
Specified cast is not valid. on line:
<asp:Image id=Image1 runat="server" ImageUrl='<%#"/Images/"+
((string)DataBinder.Eval(Container.DataItem,"MoodToday")=="Bad
Mood"?"sad":"laughing") +".gif"%>' ImageAlign="Middle">.
Thanks- Hide quoted text -
- Show quoted text -
Actually the error reads: System.InvalidCastException: Specified cast
is not valid.
and the stack Trace
[InvalidCastException: Specified cast is not valid.]
ASP.DashBoard_aspx.__DataBind__control16(Object sender, EventArgs
e) in c:\inetpub\wwwroot\Dash_Board\DashBoard.aspx:46
System.Web.UI.Control.OnDataBinding(EventArgs e)
System.Web.UI.Control.DataBind()
System.Web.UI.Control.DataBind()
System.Web.UI.Control.DataBind()
System.Web.UI.WebControls.DataGrid.CreateItem(Int32 itemIndex,
Int32 dataSourceIndex, ListItemType itemType, Boolean dataBind, Object
dataItem, DataGridColumn[] columns, TableRowCollection rows,
PagedDataSource pagedDataSource)
System.Web.UI.WebControls.DataGrid.CreateControlHierarchy(Boolean
useDataSource)
System.Web.UI.WebControls.BaseDataList.OnDataBinding(EventArgs e)
System.Web.UI.WebControls.BaseDataList.DataBind()
Dash_Board.DashBoard.Bind() in c:\inetpub\wwwroot\dash_board
\dashboard.aspx.cs:109
Dash_Board.DashBoard.dgis_ItemCommand(Object source,
DataGridCommandEventArgs e) in c:\inetpub\wwwroot\dash_board
\dashboard.aspx.cs:176
System.Web.UI.WebControls.DataGrid.OnUpdateCommand(DataGridCommandEventArgs
e)
System.Web.UI.WebControls.DataGrid.OnBubbleEvent(Object source,
EventArgs e)
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs
args)
System.Web.UI.WebControls.DataGridItem.OnBubbleEvent(Object source,
EventArgs e)
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs
args)
System.Web.UI.WebControls.LinkButton.OnCommand(CommandEventArgs e)
System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String
eventArgument)
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
sourceControl, String eventArgument)
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData)
System.Web.UI.Page.ProcessRequestMain()
Help me please.
Thanks