Hey all I am trying to assign a DBNull to an int class value as shown below:
namespace ETTData.Models
{
public class CHeld
{
public class AdNo {
public int RequestID { get; set; } = DBNull.Value;
public string TLead { get; set; } = DBNull.Value;
public DateTime RequestDate { get; set; } = DBNull.Value;
}
}
}
However, I get the error(s) of:
Error CS0029 Cannot implicitly convert type 'System.DBNull' to 'int' ETTData
Error CS0029 Cannot implicitly convert type 'System.DBNull' to 'string' ETTData
Error CS0037 Cannot convert null to 'DateTime' because it is a non-nullable value type
This also seems to be an issue when doing a DateTime and string varibles?
What would I be missing in order to get this to work?