Name of columns in web service return xml

Asked

Viewed 70 times

3

That line gives me that mistake:

if (db.T_TarefaParceiro.Max(p => p.IDTarefaParceiro) != null)

The mistake

The cast to value type 'System.Int32' failed because the materialized value is null. Either the result type's generic parameter or the query must use a nullable type.

Since the Idtarepartner field is a primary key, it cannot be nullable. How do I resolve this?

1 answer

4


I resolved so:

if (db.T_TarefaParceiro.Max(p => (int?)p.IDTarefaParceiro) != null)

Browser other questions tagged

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