下面的代码有些问题,我调试了好久都没改对,请高手帮我看看。
DropDownListPhoto.DataSource = imagemanage.GetAllPhoto("tb_Image").Tables[0].DefaultView;
DropDownListPhoto.DataTextField = "PhotoID";
DropDownListPhoto.DataBind();
imagemanage.PhotoID =Convert.ToInt32(DropDownListPhoto.SelectedValue);
imgPhoto.ImageUrl =imagemanage.FindPhotoByID(imagemanage,"tb_Image").Tables[0].Rows[0][1].ToString();
说明: 执行当前 Web 请求期间,出现未处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。
异常详细信息: System.FormatException: 输入字符串的格式不正确。
for (int i = 0; i < usermanage.GetAllUser("tb_User").Tables[0].Rows.Count; i ++)
{
gvUserInfo.Rows[i].Cells[2].Text=Convert.ToDateTime(usermanage.GetAllUser("tb_User").Tables[0].Rows[i][4].ToString()).ToLongDateString();
}
报错:该字符串未被识别为有效的 DateTime。
请大虾帮忙。。。