1. Problem description:
Unhandled Exception: System.Data.SqlTypes.SqlNullValueException: Data is Null. This method or property cannot be called on Null values.
at System.Data.SqlClient.SqlBuffer.get_DateTime()
at System.Data.SqlClient.SqlDataReader.GetDateTime(Int32 i)
EF Core model read a Null date field.
solution:
1. Set the date as nullable type
public class Student
{
public int Id { get; set; }
// public DateTime Entry_Date { get; set; }
public DateTime? Entry_Date { get; set; }
}
2. Modify data.
Read More:
- nested exception is org.hibernate.PropertyAccessException: Null value was assigned to a property
- org.apache.ibatis.type.TypeException: Error setting non null for parameter #4 with JdbcType null
- Question: Vue or HTML prompts “cannot red property getcontext of null” when creating canvas?
- The background object of thymeleaf is null, which solves the problem of error when the object is empty to get the property value
- [Vue warn]: Error in nextTick: “TypeError: Cannot read property ‘map‘ of null“
- Nodejs: TypeError: The super constructor to “inherits“ must not be null or undefined
- This (code, message, data: null) still exists after importing spring cloud project into Lombok; the data in the project is unrecognized
- Uncaught typeerror: cannot set property ‘of null error resolution
- Error:null value in entry: incrementalFolder=null
- ERROR 1048 (23000): Column ‘courseno‘ cannot be null
- Uncaught TypeError: Cannot read property ‘replace’ of null
- C ා programming encountered an object reference is required for the non-static field, method, or property error
- Open the Cocos creator editor and report an error property UUID of null
- Getactionbar is null
- When the spring MVC project is running on idea, an error is reported when the controller is a null pointer
- org.springframework.dao.InvalidDataAccessApiUsageException: Bean object must not be null; nested exc
- When feign is called, the solution of request method ‘post’ not supported appears
- In Struts2, the value read from the foreground JSP page is null
- AAPT: error: ‘null‘ is incompatible with attribute button (attr) reference.