我係用Microsoft Visual Studio 2008做ga
相簿黎
我有1個database~~Comment
Comment入面有,ID,Title,ImageUrl,message
咁用formview用LOAD個datebase
再係個相簿到自動搵ID自動比我進行更改,update d title,image ,message
但係呢到係咁error我
protected void FormView1_ItemUpdating(object sender, FormViewUpdateEventArgs e)
{
FormView formView = (FormView)sender;
FileUpload upload = (FileUpload)formView.FindControl("ImageFileUpload");
string physicalPath = Server.MapPath("photo");
string fileTitle = Path.GetFileName(upload.FileName);
string fileName = Path.Combine(physicalPath, fileTitle);
upload.SaveAs(fileName);
e.NewValues["ImageUrl"] = string.Format("photo/{0}", fileTitle);
insert我係做到我,唔知點解update唔得