I can't retrieve my data from the tables ASP.NET Core MVC

Viewed 57

I have tried before that was normal, I don't know why this happens. I can't retrieve my data from tables. Only this table can't get the data. On the other its all normal

Error message

SqlNullValueException: Data is Null. This method or property cannot be called on Null values.

Data count screenshot

Data count from breakpoints

Controller code

public IActionResult IndexWGI()
    {
        IEnumerable<VerDummyWellGeneralInformation> wgi = _db.VerDummyWellGeneralInformations;
        return View(wgi);
    }

all of my others index just the same but on this one wont get any data

Edit 1 Model Code

public partial class VerDummyWellGeneralInformation
{
    [Key] public int No { get; set; }
    public string? Well { get; set; }
    public string? OriginalOwnerCompany { get; set; }
    public string? OwnerCompany { get; set; }
    public string? OriginalOperatorCompany { get; set; }
    public string? OperatorCompany { get; set; }
    public string? WellName { get; set; }
    public string? WellShortName { get; set; }
    public string? LocationName { get; set; }
    public string? UniqueWellId { get; set; }
    public string? BoreholeName { get; set; }
    public string? BoreholeShortName { get; set; }
    public string? UniqueBoreholeId { get; set; }
    public string? AliasName { get; set; }
    public string? Field { get; set; }
    public string? Structure { get; set; }
    public string? Basin { get; set; }
    public string? District { get; set; }
    public string? County { get; set; }
    public string? Province { get; set; }
    public string? Country { get; set; }
    public string? IdPepmaps { get; set; }
    public string? Latitude { get; set; }
    public string? Longitude { get; set; }
    public string? BottomLatitude { get; set; }
    public string? BottomLongitude { get; set; }
    public string? Easting { get; set; }
    public int Northing { get; set; }
    public string? BottomEasting { get; set; }
    public string? BottomNorthing { get; set; }
    public string? UtmZone { get; set; }
    public string? Elipsoid { get; set; }
    public string? Datum { get; set; }
    public string? SourceOfCoordinate { get; set; }
    public string? VerficationStatusOfCoordinate { get; set; }
    public string? WellLocation { get; set; }
    public string? DrillingMeasuredFrom { get; set; }
    public string? LogMeasuredFrom { get; set; }
    public string? PermanentDatum { get; set; }
    public string? Kb { get; set; }
    public string? Df { get; set; }
    public string? Rt { get; set; }
    public string? Gl { get; set; }
    public string? DrillingBottomDepthTvd { get; set; }
    public string? DrillingBottomDepthMd { get; set; }
    public string? DrillingBottomDepthTvdss { get; set; }
    public string? LoggingBottomDepthMd { get; set; }
    public string? UnitMeasurementMeterFeet { get; set; }
    public string? RigName { get; set; }
    public string? SpudDate { get; set; }
    public string? FinalDrillTotalDepthDate { get; set; }
    public string? CompletionDate { get; set; }
    public string? AbandonmentDate { get; set; }
    public string? DrillingCompany { get; set; }
    public string? LoggingCompany { get; set; }
    public string? BoreholeProfile { get; set; }
    public string? RecordedBy { get; set; }
    public string? WitnessedBy { get; set; }
    public string? WellStatus { get; set; }
    public string? SeismicReference { get; set; }
    public DateTime? RowCreated { get; set; }
}

Model Builder Code

modelBuilder.Entity<VerTempWellGeneralInformation>(entity =>
        {
            

            entity.ToTable("VER_TEMP_WELL__GENERAL_INFORMATION", "db_owner");

            entity.Property(e => e.AbandonmentDate)
                .HasMaxLength(512)
                .IsUnicode(false)
                .HasColumnName("Abandonment_Date");

            entity.Property(e => e.AliasName)
                .HasMaxLength(512)
                .IsUnicode(false)
                .HasColumnName("Alias_Name");

            entity.Property(e => e.Basin)
                .HasMaxLength(512)
                .IsUnicode(false);

            entity.Property(e => e.BoreholeName)
                .HasMaxLength(512)
                .IsUnicode(false)
                .HasColumnName("Borehole_Name");

            entity.Property(e => e.BoreholeProfile)
                .HasMaxLength(512)
                .IsUnicode(false)
                .HasColumnName("Borehole_profile");

            entity.Property(e => e.BoreholeShortName)
                .HasMaxLength(512)
                .IsUnicode(false)
                .HasColumnName("Borehole_Short_Name");

            entity.Property(e => e.BottomEasting)
                .HasMaxLength(512)
                .IsUnicode(false)
                .HasColumnName("Bottom_Easting");

            entity.Property(e => e.BottomLatitude)
                .HasMaxLength(512)
                .IsUnicode(false)
                .HasColumnName("Bottom_Latitude");

            entity.Property(e => e.BottomLongitude)
                .HasMaxLength(512)
                .IsUnicode(false)
                .HasColumnName("Bottom_Longitude");

            entity.Property(e => e.BottomNorthing)
                .HasMaxLength(512)
                .IsUnicode(false)
                .HasColumnName("Bottom_Northing");

            entity.Property(e => e.CompletionDate)
                .HasMaxLength(512)
                .IsUnicode(false)
                .HasColumnName("Completion_Date");

            entity.Property(e => e.Country)
                .HasMaxLength(512)
                .IsUnicode(false);

            entity.Property(e => e.County)
                .HasMaxLength(512)
                .IsUnicode(false);

            entity.Property(e => e.Datum)
                .HasMaxLength(512)
                .IsUnicode(false)
                .HasColumnName("DATUM");

            entity.Property(e => e.Df)
                .HasMaxLength(512)
                .IsUnicode(false)
                .HasColumnName("DF");

            entity.Property(e => e.District)
                .HasMaxLength(512)
                .IsUnicode(false);

            entity.Property(e => e.DrillingBottomDepthMd)
                .HasMaxLength(512)
                .IsUnicode(false)
                .HasColumnName("Drilling_Bottom_Depth_MD");

            entity.Property(e => e.DrillingBottomDepthTvd)
                .HasMaxLength(512)
                .IsUnicode(false)
                .HasColumnName("Drilling_Bottom_Depth_TVD");

            entity.Property(e => e.DrillingBottomDepthTvdss)
                .HasMaxLength(512)
                .IsUnicode(false)
                .HasColumnName("Drilling_Bottom_Depth_TVDSS");

            entity.Property(e => e.DrillingCompany)
                .HasMaxLength(512)
                .IsUnicode(false)
                .HasColumnName("Drilling_Company");

            entity.Property(e => e.DrillingMeasuredFrom)
                .HasMaxLength(512)
                .IsUnicode(false)
                .HasColumnName("Drilling_Measured_from");

            entity.Property(e => e.Easting)
                .HasMaxLength(512)
                .IsUnicode(false);

            entity.Property(e => e.Elipsoid)
                .HasMaxLength(512)
                .IsUnicode(false)
                .HasColumnName("ELIPSOID");

            entity.Property(e => e.Field)
                .HasMaxLength(512)
                .IsUnicode(false);

            entity.Property(e => e.FinalDrillTotalDepthDate)
                .HasMaxLength(512)
                .IsUnicode(false)
                .HasColumnName("Final_Drill_Total_Depth_Date");

            entity.Property(e => e.Gl)
                .HasMaxLength(512)
                .IsUnicode(false)
                .HasColumnName("GL");

            entity.Property(e => e.IdPepmaps)
                .HasMaxLength(512)
                .IsUnicode(false)
                .HasColumnName("ID_PEPMAPS");

            entity.Property(e => e.Kb)
                .HasMaxLength(512)
                .IsUnicode(false)
                .HasColumnName("KB");

            entity.Property(e => e.Latitude)
                .HasMaxLength(512)
                .IsUnicode(false);

            entity.Property(e => e.LocationName)
                .HasMaxLength(512)
                .IsUnicode(false)
                .HasColumnName("Location_Name");

            entity.Property(e => e.LogMeasuredFrom)
                .HasMaxLength(512)
                .IsUnicode(false)
                .HasColumnName("Log_Measured_from");

            entity.Property(e => e.LoggingBottomDepthMd)
                .HasMaxLength(512)
                .IsUnicode(false)
                .HasColumnName("Logging_bottom_depth_MD");

            entity.Property(e => e.LoggingCompany)
                .HasMaxLength(512)
                .IsUnicode(false)
                .HasColumnName("Logging_Company");

            entity.Property(e => e.Longitude)
                .HasMaxLength(512)
                .IsUnicode(false);

            entity.Property(e => e.No)
                .HasMaxLength(512)
                .IsUnicode(false);

            entity.Property(e => e.Northing)
                .HasMaxLength(512)
                .IsUnicode(false);

            entity.Property(e => e.OperatorCompany)
                .HasMaxLength(512)
                .IsUnicode(false)
                .HasColumnName("Operator_Company");

            entity.Property(e => e.OriginalOperatorCompany)
                .HasMaxLength(512)
                .IsUnicode(false)
                .HasColumnName("Original_Operator_Company");

            entity.Property(e => e.OriginalOwnerCompany)
                .HasMaxLength(512)
                .IsUnicode(false)
                .HasColumnName("Original_Owner_Company");

            entity.Property(e => e.OwnerCompany)
                .HasMaxLength(512)
                .IsUnicode(false)
                .HasColumnName("Owner_Company");

            entity.Property(e => e.PermanentDatum)
                .HasMaxLength(512)
                .IsUnicode(false)
                .HasColumnName("Permanent_Datum");

            entity.Property(e => e.Province)
                .HasMaxLength(512)
                .IsUnicode(false);

            entity.Property(e => e.RecordedBy)
                .HasMaxLength(512)
                .IsUnicode(false)
                .HasColumnName("Recorded_by");

            entity.Property(e => e.RigName)
                .HasMaxLength(512)
                .IsUnicode(false)
                .HasColumnName("Rig_Name");

            entity.Property(e => e.RowCreated)
                .HasColumnType("datetime")
                .HasColumnName("ROW_CREATED");

            entity.Property(e => e.Rt)
                .HasMaxLength(512)
                .IsUnicode(false)
                .HasColumnName("RT");

            entity.Property(e => e.SeismicReference)
                .HasMaxLength(512)
                .IsUnicode(false)
                .HasColumnName("Seismic_Reference");

            entity.Property(e => e.SourceOfCoordinate)
                .HasMaxLength(512)
                .IsUnicode(false)
                .HasColumnName("Source_of_Coordinate");

            entity.Property(e => e.SpudDate)
                .HasMaxLength(512)
                .IsUnicode(false)
                .HasColumnName("Spud_Date");

            entity.Property(e => e.Structure)
                .HasMaxLength(512)
                .IsUnicode(false);

            entity.Property(e => e.UniqueBoreholeId)
                .HasMaxLength(512)
                .IsUnicode(false)
                .HasColumnName("Unique_Borehole_ID");

            entity.Property(e => e.UniqueWellId)
                .HasMaxLength(512)
                .IsUnicode(false)
                .HasColumnName("Unique_Well_ID");

            entity.Property(e => e.UnitMeasurementMeterFeet)
                .HasMaxLength(512)
                .IsUnicode(false)
                .HasColumnName("Unit_measurement_METER_FEET");

            entity.Property(e => e.UtmZone)
                .HasMaxLength(512)
                .IsUnicode(false)
                .HasColumnName("UTM_ZONE");

            entity.Property(e => e.VerficationStatusOfCoordinate)
                .HasMaxLength(512)
                .IsUnicode(false)
                .HasColumnName("Verfication_Status_of_Coordinate");

            entity.Property(e => e.Well)
                .HasMaxLength(512)
                .IsUnicode(false);

            entity.Property(e => e.WellLocation)
                .HasMaxLength(512)
                .IsUnicode(false)
                .HasColumnName("Well_Location");

            entity.Property(e => e.WellName)
                .HasMaxLength(512)
                .IsUnicode(false)
                .HasColumnName("Well_Name");

            entity.Property(e => e.WellShortName)
                .HasMaxLength(512)
                .IsUnicode(false)
                .HasColumnName("Well_Short_Name");

            entity.Property(e => e.WellStatus)
                .HasMaxLength(512)
                .IsUnicode(false)
                .HasColumnName("Well_Status");

            entity.Property(e => e.WitnessedBy)
                .HasMaxLength(512)
                .IsUnicode(false)
                .HasColumnName("Witnessed_by");
        });
 

Database table screenshot SS

1 Answers

Sorry i was realize my model data type changed by find and replace.

public int Northing { get; set; }

that is the code that misrenamed

Related