Mostrando entradas con la etiqueta MOSTRAR IMAGEN ALMACENADA EN BASE DE DATOS (campo image) EN UN PICTUREBOX. Mostrar todas las entradas
Mostrando entradas con la etiqueta MOSTRAR IMAGEN ALMACENADA EN BASE DE DATOS (campo image) EN UN PICTUREBOX. Mostrar todas las entradas

MOSTRAR IMAGEN ALMACENADA EN BASE DE DATOS (campo image) EN UN PICTUREBOX

Try
   Dim rI As ADODB.Recordset, cI As ADODB.Connection
   'función que conecta a base de datos y retorna recordset
   ConnSQL(rI, cI "BDEMPRESA","SERVIDOR","sa","emp48", "Select foto from clientes(NOLOCK) where codcli='" & codigoCliente & "'")
   If Not rI.EOF Then
      Dim bits As Byte() = CType(rI.Fields("imagen").Value, Byte())
      Dim memorybits As New System.IO.MemoryStream(bits)
      Dim bitmap As New Bitmap(memorybits)
      picturebox1.Image = bitmap
   End If
Catch ex As Exception
   msgbox(ex.message)
End Try