Author: ASPBlue | Posted on: 2/11/2009 9:39:55 AM | Views : 250

At the submit button click, i insert a few fields. one of the field is date, and I wanted to say

that if the field is left blank by the user, then insert null, otherwise entered the date that

the user entered and convert to datetime.  I don't know what is wrong, but it keeps giving

me the error below:

"SqlDateTime overflow. Must be between 1/1/1753 12:00:00 AM and 12/31/9999 11:59:59 PM."

Any idea or input would be appreciated.

code behind:

protected void btnSubmit_Click(object sender, EventArgs e)
    {

         Convert.ToDateTime(tbStartDate.Text != "" ? Go to the complete details ...