When I run this code: var newAnagrafica = e.Entity as Anagrafica; var idParrocchia = Convert.ToInt32(Request.QueryString["idParrocchia"]); EntityKey en = new EntityKey("ParrocchiaGestDbEntities.Parrocchia", "idParrocchia", idParrocchia); newAnagrafica.ParrocchiaResidenzaReference.EntityKey = en; I get this error on the last line: Object reference not set to an instance of an object. Locally everything works fine.. Can please somebody help me?
Does your application connect to a SQL server in the back end? Did you upload the database and all the required objects and data to our SQL server?
Yes I use Sql server and I've uploaded all I need By the way I found the solution! The error comes out when I try to insert a new record setting a date field with a not valid value (ex. 24/12/1985) Thanks