Hi, I am trying to use the code below to load an image file from db but Iam getting OUTOFMEMORY EXCEPTION could anyone help me out.
Code:Private Sub SetPictures() Dim cr As DataRow For Each cr In Me.DsPictures.Pictures.Rows Me.txtID.Text = cr.Item(0) Dim arrPicture() As Byte = CType(cr.Item(1), Byte()) Dim ms As New MemoryStream(arrPicture) With PictureBox1 .Image = New Bitmap(ms) .SizeMode = PictureBoxSizeMode.StretchImage End With ms.Close() Me.txtFileName.Text = cr.Item(2) Next End Sub




Reply With Quote