hello , i am using date field in sql table , and in webforms , i am using a textbox relating to calendar extender toolkit , now if i won't select anydate from calendar , on debugging it shows "" but in database it shows 1900-01-01 . what's this going on ? i have also written on button click event :
protected void SubmitProject_OnServerClick(object sender, EventArgs e)
{
if (StartDate.Text == "" || StartDate.Text == string.Empty)
{
rec.Proj_StartDate = DBNull.Value.ToString();
}
else
{ rec.Proj_StartDate=Request.Form[StartDate.UniqueID];
}
}
also i id like this too :
protected void SubmitProject_OnServerClick(object sender, EventArgs e)
{
if (StartDate.Text == "" || StartDate.Text == string.Empty)
{
rec.Proj_StartDate = string.Empty;
}
else
{ rec.Proj_StartDate=Request.Form[StartDate.UniqueID];
}
}
but nothing happened , it still shows 1900-01-01 in database .. please solve it quickly im doing this work in office