DateTime time1 = new DateTime();try { time1 = Convert.ToDateTime(TextBox3.Text.Trim()); } catch { errorMsg = "时间字符串格式不正确,正确格式如2000-08-12"; }仔细检查你的dropdownlist 的绑定,一般情况下,绑定的DataValueField是 你的 id 字段,DataTextField 是你的 显示字段,查询的时候应该用DropDownList1.SelectedValue.string str = "select Cname,Clb,Cgn,Cjg,Cshchrq,Cbzhrq from chanpin where Cid="+DropDownList1.SelectedValue;另外,注意 page.ispostback 如果你没有在page_load里面进行判断,也会出现这样的问题