Specified cast is not valid.

Thread is closed for posting
2 posts, 0 answers
  1. Ashim
    Ashim avatar
    17 posts
    Member since:
    Nov 2010

    Posted 24 Aug 2011 Link to this post

    i have 6 charts in one page , everything works on my machine , but when i deploy the project to Server then i get "Specified cast is not valid" Error
    the problem is just from one of the charts, when i remove it ,it work at the server too.
    i put catch all around my code but i'm not getting any Exception even in the server. let me know if you need more data




    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:

    An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

    Stack Trace:

    [InvalidCastException: Specified cast is not valid.]
       System.Data.UnboxT`1.ValueField(Object value) +51
       System.Data.DataRowExtensions.Field(DataRow row, String columnName) +51
       ThinClient.DashBoard.WUC_Collection_Chart.<LinqDataSource_Collections_Selecting>b__2(DataRow Collect) +138
       System.Linq.WhereSelectEnumerableIterator`2.MoveNext() +151
       System.Linq.<SkipIterator>d__4d`1.MoveNext() +86
       System.Linq.<TakeIterator>d__3a`1.MoveNext() +127
       System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) +327
       System.Linq.Enumerable.ToList(IEnumerable`1 source) +58
    
    [TargetInvocationException: Exception has been thrown by the target of an invocation.]
       System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner) +0
       System.RuntimeMethodHandle.InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeType typeOwner) +72
       System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) +251
       System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +28
       System.Web.UI.WebControls.QueryableDataSourceHelper.ToList(IQueryable query, Type dataObjectType) +129
       System.Web.UI.WebControls.LinqDataSourceView.ExecuteSelect(DataSourceSelectArguments arguments) +343
       System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +21
       Telerik.Web.UI.RadChart.PerformSelect() +159
       Telerik.Web.UI.RadChart.DataBind() +98
       System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +66
       Telerik.Web.UI.RadChart.OnPreRender(EventArgs e) +22
       System.Web.UI.Control.PreRenderRecursiveInternal() +103
       System.Web.UI.Control.PreRenderRecursiveInternal() +175
       System.Web.UI.Control.PreRenderRecursiveInternal() +175
       System.Web.UI.Control.PreRenderRecursiveInternal() +175
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2496
    


    Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1              

      
  2. Ashim
    Ashim avatar
    17 posts
    Member since:
    Nov 2010

    Posted 26 Aug 2011 Link to this post

    Solved after reinstalling .Net 4 on the Server
Back to Top