string date = DateTime.Now.AddDays(day - 1).ToShortDateString().ToString();
string count = "select count(*) from Appointment_Info where APPT_Dt=\'" +
Convert.ToDateTime(date) + "\' ";
SqlCommand cc = new SqlCommand(count, cn);
int appoinments = Convert.ToInt16(cc.ExecuteScalar().ToString());
上面的查询不起作用查看并告诉他们是否有任何问题?日期时间的SQL查询
使用参数,它的确比格式化日期更好... – Marco
@sikender:我想你的意思是说'你需要指定你得到什么样的错误。 – jgauffin