Non-static Method error requires a destination. '

Asked

Viewed 1,216 times

2

I have a little problem and I need your help to help me solve it. .

How the error is occurring:

Basically it is occurring, when I click on a button to open a modal to bring the information I want within this listing, however this "Occurrences", is necessary for other modals (front screens), I am using it to take advantage and catch the idCarregamento, for me to make the comparison and bring the information.

I know that there is firstordefault(); however I believe it is this way because I am wanting 1 information

  • This error usually occurs because there is some variable with null reference in a lambda expression, check the model (Occurrencedatamodel model), it is null??

  • Champion checks if the model or model.idThe current is null. I had a mistake like this and the reply of the friend Adimar solved for me, it was something within the expression that was null.

1 answer

-1

Usually this error occurs when some object of your expression is null.

Make a check before to know if this ctx.tb_occurrence is null, only after making sure you actually make your select.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.