This question is locked. New answers and comments are not allowed.
After the update I have some pages crashing with the following error
Server Error in '/' Application.
Exception Details: System.InvalidCastException: Invalid cast from 'System.String' to 'System.Guid'.
Source Error:
Source File: d:\websites\ca\medportal\postgrad\Apps\RTO\Admin\ProgramConfig.aspx.cs Line: 104
Stack Trace:
And here is the Query
Server Error in '/' Application.
Invalid cast from 'System.String' to 'System.Guid'.
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: Invalid cast from 'System.String' to 'System.Guid'.
Source Error:
Line 102:
Line 103: protected void rotationGrid_NeedDataSource(object source, GridNeedDataSourceEventArgs e) {
Line 104: var requests = (from r in RTOHelper.RTOScope.Extent<ProgramRotationHospital>()
Line 105: where r.ProgramID == this.ProgramID
Line 106: orderby r.Rotation.RotationName
|
Source File: d:\websites\ca\medportal\postgrad\Apps\RTO\Admin\ProgramConfig.aspx.cs Line: 104
Stack Trace:
[InvalidCastException: Invalid cast from 'System.String' to 'System.Guid'.] System.Convert.DefaultToType(IConvertible value, Type targetType, IFormatProvider provider) +12556446 System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider) +12813919 System.Convert.ChangeType(Object value, Type conversionType) +133 Telerik.OpenAccess.Query.NullableConverter`1.Convert(ResultData& data) +1003 Telerik.OpenAccess.Query.ObjectConstructor.Convert(ResultData& data) +102 Telerik.OpenAccess.Query.TypedEnumerator`1.ObtainCurrent() +267 Telerik.OpenAccess.Query.TypedEnumerator`1.System.Collections.Generic.IEnumerator<T>.get_Current() +24 System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) +431 System.Linq.Enumerable.ToList(IEnumerable`1 source) +80 Apps_RTO_Admin_ProgramConfig.rotationGrid_NeedDataSource(Object source, GridNeedDataSourceEventArgs e) in d:\websites\ca\medportal\postgrad\Apps\RTO\Admin\ProgramConfig.aspx.cs:104 Telerik.Web.UI.RadGrid.OnNeedDataSource(GridNeedDataSourceEventArgs e) +191 Telerik.Web.UI.RadGrid.AutoDataBind(GridRebindReason rebindReason) +109 Telerik.Web.UI.RadGrid.OnLoad(EventArgs e) +254 System.Web.UI.Control.LoadRecursive() +71 System.Web.UI.Control.LoadRecursive() +190 System.Web.UI.Control.LoadRecursive() +190 System.Web.UI.Control.LoadRecursive() +190 System.Web.UI.Control.LoadRecursive() +190 System.Web.UI.Control.LoadRecursive() +190 System.Web.UI.Control.LoadRecursive() +190 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3048 |
And here is the Query
var requests = (from r
in
RTOHelper.RTOScope.Extent<ProgramRotationHospital>()
where r.ProgramID ==
this
.ProgramID
orderby r.Rotation.RotationName
select
new
{
ID = r.Id,
RotationName = r.Rotation.RotationName,
HospitalName = r.Hospital.HospitalName,
HospitalID = r.HospitalID,
RotationID = r.RotationID,
ProgramID = r.ProgramID,
ChainID = r.ChainID,
AllowChange = r.AllowChange
}).ToList();