hi,
I have table in database save image in record, so how to know the field img know exist picture or not
when call in query
Using koneksi As New SqlConnection(ambilstringkoneksi)
Dim perintah As SqlCommand = New SqlCommand("select * from tempimage where idp='123'", koneksi)
perintah.CommandType = CommandType.Text
koneksi.Open()
Dim myreader As SqlDataReader = perintah.ExecuteReader(CommandBehavior.CloseConnection)
If myreader.Read() Then
Dim bytes() As Byte = CType(myreader("img"), Byte())
Response.Cache.SetCacheability(HttpCacheability.NoCache)
Response.BinaryWrite(bytes)
Response.Flush()
Response.End()
Else
MsgBox("data not found")
End If
myreader.Close()
koneksi.Close()
End Using