求救字符转化DateTime
确保方法参数的格式正确。将一个字符串转化成为DateTime时,先分析该字符串以获取日期,然后再将每个变量放置到DateTime对象中。我的程序是这样子的: for (int i = 0; i < GridView1.Rows.Count; i++)
{DateTime DT = Convert.ToDateTime( GridView1.Rows[i].Cells[5].Text); if (DT.AddDays(3) < DateTime.Today)
{
Image img1 = (Image)GridView1.Rows[i].FindControl("Image1");
img1.Visible = false;
}
if (Convert.ToInt32(GridView1.Rows[i].Cells[4].Text) < 5)
{
Image img2 = (Image)GridView1.Rows[i].FindControl("Image2");
img2.Visible = false;
}}这怎么改了