嗨,当我尝试从文本框中捕获日期时,当我尝试观看该参数时,它显示错误

时间:2017-03-09 06:57:26

标签: c# asp.net

当我尝试从文本框中捕获日期时,当我尝试观看该参数时显示错误

  

(无法计算表达式,因为线程在某一点停止   垃圾收集是不可能的,可能是因为代码是   优化。)

DateTime logstartdate = Convert.ToDateTime(txtfromdate.Text);
DateTime logenddate = Convert.ToDateTime(txttodate.Text);

DateTime logfdate = Convert.ToDateTime(txtfromdate.Text);
DateTime logtdate = Convert.ToDateTime(txttodate.Text);
DateTime stdate = Convert.ToDateTime(txtstartdate.Text);

DateTime startdate = Convert.ToDateTime(txtstartdate.Text);
DateTime closedate = Convert.ToDateTime(txtenddate.Text);
if (logfdate <= stdate && stdate >= logtdate)
{
    lblmessage.Visible = true;
    lblmessage.Text = "Sorry!start date must be in between the log start date and log end date";
    return;
}

0 个答案:

没有答案