27-09-22, 03:02 AM
جرب الكود التالي ، إن شاء الله ينجح :
كود :
Dim ms As New MemoryStream()
Dim p As New SqlParameter("@item_pic", SqlDbType.Image)
If dgv_unit.Rows(i).Cells(11).Value.ToString <> vbNullString Then
dgv_unit.Rows(i).Cells(11).Value.Save(ms, System.Drawing.Imaging.ImageFormat.Jpeg)
Dim picture() As Byte = ms.ToArray
.Parameters.AddWithValue("@item_pic", SqlDbType.Image).Value = picture
Else
MsgBox("الصورة غير موجودة")
End If

