在将时间部分传递给 GridView 之前,如何从 DateTime 中删除时间部分。我正在使用 VS2008,否则我将使用 Date :(
DataTable datatablePlanning = new DataTable("Planning");
DateTime begindate = DatePicker1.SelectedDate;
DataRow detailregel = datatablePlanning.NewRow();
detailregel["Date"] = begindate;
datatablePlanning.Rows.Add(detailregel);
GridView2.DataSource = datatablePlanning;
GridView2.DataBind();