If fileUpload1.HasFile Then
Dim File As HttpPostedFile = fileUpload1.PostedFile
imgByte = New [Byte](File.ContentLength - 1) {}
File.InputStream.Read(imgByte, 0, File.ContentLength)
myNews.Image = imgByte
Else
myNews.Image = Nothing
end if
---
以上code重點在必須加myNews.Image = Nothing
沒有留言:
張貼留言