string con = ConfigurationManager.ConnectionStrings["connectionString"].ConnectionString;
SqlConnection cn = new SqlConnection(con);
string insert_jobseeker = "INSERT INTO JobSeeker_Registration(Password,HintQuestion,Answer,Date)"
+ " values (@Password,@HintQuestion,@Answer,@Date)";
SqlCommand cmd = new SqlCommand();
cmd.Connection = cn;
cmd.CommandType = CommandType.Text;
cmd.CommandText = insert_jobseeker;
cmd.Parameters.Add(new SqlParameter("@Password", SqlDbType.VarChar, 50));
cmd.Parameters["@Password"].Value = txtPassword.Text;
cmd.Parameters.Add(new SqlParameter("@HintQuestion", SqlDbType.VarChar, 50));
cmd.Parameters["@HintQuestion"].Value = ddlQuestion.Text;
cmd.Parameters.Add(new SqlParameter("@Answer", SqlDbType.VarChar, 50));
cmd.Parameters["@Answer"].Value = txtAnswer.Text;
**cmd.Parameters.Add(new SqlParameter("@Date", SqlDbType.DateTime));
cmd.Parameters["@Date"].Value = System.DateTime.Now**
我得到了错误
“SqlDateTime 溢出。必须在 1/1/1753 12:00:00 AM 和 12/31/9999 11:59:59 PM 之间。”
解决方案是什么?