You cannot convert DBNull.Valueto Int64how your code is trying to do in Convert.ToInt64. DBNull.Valuemeans "unknown" or "nonexistent," and therefore there is no logical conversion to any other data type.
materialIn - DataRow, SetMeasurementIdNull, . Linq SQL EF, DBNull, materialIn.measurementId = null.