Click here to Skip to main content
14,689,512 members
Home » Discussions » .NET (Core and Framework)
   

.NET (Core and Framework)

 
GeneralRe: Get list from list of elements link and collections Pin
simpledeveloper13-Dec-19 9:24
Membersimpledeveloper13-Dec-19 9:24 
QuestionThe operation failed: The relationship could not be changed because one or more of the foreign-key - EF Code first Pin
simpledeveloper6-Dec-19 7:45
Membersimpledeveloper6-Dec-19 7:45 
AnswerRe: The operation failed: The relationship could not be changed because one or more of the foreign-key - EF Code first Pin
Gerry Schmitz6-Dec-19 8:29
mveGerry Schmitz6-Dec-19 8:29 
GeneralRe: The operation failed: The relationship could not be changed because one or more of the foreign-key - EF Code first Pin
simpledeveloper6-Dec-19 8:52
Membersimpledeveloper6-Dec-19 8:52 
GeneralRe: The operation failed: The relationship could not be changed because one or more of the foreign-key - EF Code first Pin
simpledeveloper9-Dec-19 10:12
Membersimpledeveloper9-Dec-19 10:12 
GeneralRe: The operation failed: The relationship could not be changed because one or more of the foreign-key - EF Code first Pin
simpledeveloper9-Dec-19 15:40
Membersimpledeveloper9-Dec-19 15:40 
AnswerRe: The operation failed: The relationship could not be changed because one or more of the foreign-key - EF Code first Pin
simpledeveloper10-Dec-19 10:11
Membersimpledeveloper10-Dec-19 10:11 
QuestionException: Nullable object must have a value while typecasting in a Linq query Pin
simpledeveloper4-Dec-19 11:29
Membersimpledeveloper4-Dec-19 11:29 
I have a Linq statement as below
{ if (!inspectionItemIds.Contains((int)item.InspectionItemId)) inspectionItemIds.Add((int)item.InspectionItemId); });


And item.InspectionItemId is coming as null and its throwing me exception as below:
System.InvalidOperationException
      HResult=0x80131509
      Message=Nullable object must have a value.
      Source=mscorlib
      StackTrace:
       at System.ThrowHelper.ThrowInvalidOperationException(ExceptionResource resource)
       at System.Nullable`1.get_Value()
       at IMS.Model.DomainLogic.ViolationManager.<>c__DisplayClass19_0.<ViolationsFor>b__9(Violation item) in C:\SourceCode\IMS\Development\IMS\IMS.Model\DomainLogic\ViolationManager.cs:line 254
       at System.Collections.Generic.List`1.ForEach(Action`1 action)
       at IMS.Model.DomainLogic.ViolationManager.ViolationsFor(String for, Int32 id) in C:\SourceCode\IMS\Development\IMS\IMS.Model\DomainLogic\ViolationManager.cs:line 253
       at IMS.Web.Controllers.CaseController.Details(Int32 id, Boolean isPrint) in C:\SourceCode\IMS\Development\IMS\IMS.Web\Controllers\CaseController.cs:line 382
       at System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters)
       at System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters)
       at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters)
       at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c.<BeginInvokeSynchronousActionMethod>b__9_0(IAsyncResult asyncResult, ActionInvocation innerInvokeState)
       at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult`2.CallEndDelegate(IAsyncResult asyncResult)
       at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResultBase`1.End()
       at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult)
       at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass11_0.<InvokeActionMethodFilterAsynchronouslyRecursive>b__0()
       at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass11_2.<InvokeActionMethodFilterAsynchronouslyRecursive>b__2()


Any help to resolve these types of issues? Any help would be very very helpful - thanks in advance.
AnswerRe: Exception: Nullable object must have a value while typecasting in a Linq query Pin
phil.o4-Dec-19 11:51
mvephil.o4-Dec-19 11:51 
AnswerRe: Exception: Nullable object must have a value while typecasting in a Linq query Pin
Richard MacCutchan4-Dec-19 23:11
mveRichard MacCutchan4-Dec-19 23:11 
AnswerRe: Exception: Nullable object must have a value while typecasting in a Linq query Pin
Richard Deeming5-Dec-19 2:06
mveRichard Deeming5-Dec-19 2:06 
AnswerRe: Exception: Nullable object must have a value while typecasting in a Linq query Pin
simpledeveloper5-Dec-19 7:28
Membersimpledeveloper5-Dec-19 7:28 
GeneralRe: Exception: Nullable object must have a value while typecasting in a Linq query Pin
Richard MacCutchan5-Dec-19 8:51
mveRichard MacCutchan5-Dec-19 8:51 
QuestionHow to connect multiple computers to the same database? Pin
SebGM252-Dec-19 15:53
MemberSebGM252-Dec-19 15:53 
AnswerRe: How to connect multiple computers to the same database? Pin
Richard Deeming3-Dec-19 1:41
mveRichard Deeming3-Dec-19 1:41 
GeneralRe: How to connect multiple computers to the same database? Pin
Member 1468812212-Dec-19 21:12
MemberMember 1468812212-Dec-19 21:12 
GeneralRe: How to connect multiple computers to the same database? Pin
amrinde12-Dec-19 21:34
professionalamrinde12-Dec-19 21:34 
AnswerRe: How to connect multiple computers to the same database? Pin
Maciej Los3-Dec-19 2:44
mveMaciej Los3-Dec-19 2:44 
GeneralRe: How to connect multiple computers to the same database? Pin
Richard Deeming3-Dec-19 3:07
mveRichard Deeming3-Dec-19 3:07 
PraiseRe: How to connect multiple computers to the same database? Pin
Maciej Los3-Dec-19 4:19
mveMaciej Los3-Dec-19 4:19 
GeneralOT Pin
Richard Deeming3-Dec-19 4:25
mveRichard Deeming3-Dec-19 4:25 
GeneralRe: OT Pin
Maciej Los3-Dec-19 4:34
mveMaciej Los3-Dec-19 4:34 
PraiseRe: OT Pin
Richard Deeming3-Dec-19 4:38
mveRichard Deeming3-Dec-19 4:38 
GeneralRe: How to connect multiple computers to the same database? Pin
Richard MacCutchan4-Dec-19 0:17
mveRichard MacCutchan4-Dec-19 0:17 
AnswerRe: How to connect multiple computers to the same database? Pin
Dave Kreskowiak3-Dec-19 5:31
mveDave Kreskowiak3-Dec-19 5:31 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.