0

Everytime i want to execute this code (open in a new form the content of the datagridview) i got this error:

"Parameter IS NOT valid".

There is the code:

Private Sub DataGridView1_CellClick(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellClick

    Try
        info.TextBox1.Text = DataGridView1.CurrentRow.Cells(1).Value.ToString()
        info.TextBox2.Text = DataGridView1.CurrentRow.Cells(2).Value.ToString()
        info.TextBox3.Text = DataGridView1.CurrentRow.Cells(3).Value.ToString()
        info.TextBox4.Text = DataGridView1.CurrentRow.Cells(4).Value.ToString()
        info.TextBox5.Text = DataGridView1.CurrentRow.Cells(5).Value.ToString()

        Dim ms As New MemoryStream(CType(DataGridView1.CurrentRow.Cells(6).Value, Byte()))
        info.PictureBox1.Image = Image.FromStream(ms)
    Catch ex As Exception
        MsgBox(ex.Message)
    End Try

    info.Show()
End Sub
Razvan Balaci
  • 51
  • 1
  • 10
  • 1
    Possible duplicate of [Parameter is not valid error when creating image from byte\[\] in c#](http://stackoverflow.com/questions/5285213/parameter-is-not-valid-error-when-creating-image-from-byte-in-c-sharp) – Alex B. Apr 12 '16 at 08:47
  • Other duplicates with answer: http://stackoverflow.com/questions/17667818/error-parameter-is-not-valid-while-converting-bytes-into-image http://stackoverflow.com/questions/629955/parameter-not-valid-exception-loading-system-drawing-image – Alex B. Apr 12 '16 at 08:48
  • nop :/ is not that :s – Razvan Balaci Apr 13 '16 at 09:55

0 Answers0