I made a application in asp.net c# using linq and oracle database.This application is working fine on Widows 7 32 bit local host.But When I deployed this application in windows server 2008 r2.It gives a following error.Guide me what is the following error.How Can I check this error on deployment server and How can I resolved this error
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) +54
sis.<>c__DisplayClass55.b__0(DataRow r) +38
System.Linq.WhereEnumerableIterator`1.MoveNext() +156
System.Linq.WhereSelectEnumerableIterator`2.MoveNext() +165
System.Linq.d__81`1.MoveNext() +472
System.Linq.Enumerable.Count(IEnumerable`1 source) +267
sis.regreport.Page_Load(Object sender, EventArgs e) +5015
System.Web.UI.Control.LoadRecursive() +71
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean
includeStagesAfterAsyncPoint) +3178
var vcolM = dt.AsEnumerable()
.Where(r => r.Field<string>("MAJ") == (string)vprglist
&& r.Field<string>("SPEC") == (string)vspecourse
&& r.Field<string>("L_ABR_CODE") == (string)genderEng[1]
&& r.Field<string>("reg") == (string)drRegion["reg"]
&& r.Field<decimal>("year") == syrcnt)
.Sum(r => Convert.ToInt32(r["strength"]));
All linq like above working fine in local pc.But giving error in windows server 2008.Where syrcnt is int.