This is a migrated thread and some comments may be shown as answers.

Specified cast is not valid.

1 Answer 419 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Ashim
Top achievements
Rank 1
Ashim asked on 24 Aug 2011, 11:27 PM
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              

  

1 Answer, 1 is accepted

Sort by
0
Ashim
Top achievements
Rank 1
answered on 26 Aug 2011, 10:17 PM
Solved after reinstalling .Net 4 on the Server
Tags
Chart (Obsolete)
Asked by
Ashim
Top achievements
Rank 1
Answers by
Ashim
Top achievements
Rank 1
Share this question
or