Private Sub CARI_FOTO()
MyConnection.TUTUPKONEKSI()
cmd = New SqlCommand("Select Photo, AutoRecordNoStamp From mstSTAMP " & _
"Where AutoRecordNoStamp='" & LblAutoStampNo.Text & "'", MyConnection.BUKAKONEKSI)
DTR = cmd.ExecuteReader
DTR.Read()
'Cek kalo2 data gambar ada ato gak didalam database 01.12.2014
If DTR("Photo").ToString <> "" Then
Dim Gambar As New IO.MemoryStream _
(CType(DgvSTAMP.Item(7, DgvSTAMP.CurrentRow.Index).Value, Byte()))
ImgFOTO.SizeMode = PictureBoxSizeMode.StretchImage
ImgFOTO.Image = Image.FromStream(Gambar)
Else
ImgFOTO.Image = Nothing
End If
End Sub
Comments
Post a Comment