I'm trying to insert record using C# and SQL, but i got this error when date column is empty, i searched for a similar cases but didnt solve it yet. It inserts 01/01/1900, the column in table is Datetime any idea or similar case link.
[HttpPost]
public HttpResponseMessage save (Education edu)
{
Dictionary<string, object> xmt = new Dictionary<string, object>();
xmt.Add("@Staff_Key", edu.Staff_Key);
xmt.Add("@Type_Education", edu.Type_Education);
xmt.Add("@Qual", edu.Qual);
xmt.Add("@Uni", edu.Uni);
xmt.Add("@Date_Issue", edu.Date_Issue.ToString() == null ? "Null" : edu.Date_Issue.ToString());
xmt.Add("@Notes", edu.Notes);
obj.ExecNonQuery(
@"insert into HR_DocEducation (Staff_Key,Type_Education,Qual,Uni,Date_Issue,Notes)
values (@Staff_Key,@Type_Education,@Qual,@Uni,@Date_Issue,@Notes) ",xmt);
HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.Created);
return response;