Vb.net преобразование двоичного файла в изображение, ошибка параметра
i have database, and i have a column that stored picture in access database in that column i right click it and insert object which is picture from file and it said "package" in the column the idea is i upload picture to 'pic' column in access database from file, and using 'querypic' table adapter query with parameter is 'comboname.text' is selected to return picture and store it as binary in byte of array but when i convert it to image i got an error "System.ArgumentException: 'Parameter is not valid." i checked my b() which is array of byte and it got result {length=40276} can someone help me?
Что я уже пробовал:
<pre>Private Sub cmdSelect_Click(sender As Object, e As EventArgs) Handles cmdSelect.Click Dim facultytabeladapt As New CSE_DEPTDataSetTableAdapters.FacultyTableAdapter Dim b() As Byte Dim s As String b = facultytabeladapt.querypic(ComboName.Text) PhotoBox.Image = b21(b) End Sub Private Function b21(ByVal b() As Byte) As Image Dim imgc As New ImageConverter Dim imgpic As Image = CType(imgc.ConvertFrom(b), Image) 'it has error "System.ArgumentException: 'Parameter is not valid." Return imgpic End Function
Richard MacCutchan
На какой линии возникает ошибка? Сообщение говорит вам, что вы передаете плохой параметр какому-то вызову метода.