這段代碼有什麼問題?我得到了一個錯誤的GDI +,我不知道解決。如何在vb.net中使用數據庫更新鏡像
Private Sub saveEmployee()
Dim ms As New MemoryStream
PictureBox1.Image.Save(ms, PictureBox1.Image.RawFormat)--i got error in this line..A generic error occurred in GDI+.
Dim arrPic() As Byte = ms.GetBuffer()
Dim cmdEmp As New MySqlCommand
Dim sqlEmp As String
sqlEmp = "update tbl_employee set [email protected] where emID='" & lbl_empID.Text & "'"
With cmdEmp
.Parameters.AddWithValue("@emPic", arrPic)
.ExecuteNonQuery()
End With
End Sub
你需要學習如何使用調試器。哪條線路導致錯誤?究竟是什麼錯誤?如果不盡快添加更多詳細信息,則您的問題很容易關閉。 – AbZy 2013-02-24 14:17:50
錯誤是在線 PictureBox1.Image.Save(ms,PictureBox1.Image.RawFormat) – 2013-02-24 14:19:59