29-12-18, 11:32 AM
السلام عليكم ....ارجو مساعدة في كود الصورة ...اريد عندما لا يوجد صورة يعطي رسالة لا يوجد صورة ..بمعني عندما يكون نوع الحقل صورة Null يعطي رسالة لا يوجد صورة ...اختبار حقل الصورة كيف
PictureBox3.BackgroundImage = Nothing"
Dim sql As String
sql = " select pic from Categories where Num=" & Text_Num.Text.Trim
Dim adp As New SqlDataAdapter(sql, con)
Dim ds As New DataSet
( adp.Fill(ds
If ds.Tables(0).Rows.Count <> 0 Then
(() Dim imageData() As Byte = CType(ds.Tables(0).Rows(0).Item("pic"), Byte
(Dim ms As New IO.MemoryStream(imageData
( PictureBox3.BackgroundImage = Image.FromStream(ms
End If
PictureBox3.BackgroundImage = Nothing"
Dim sql As String
sql = " select pic from Categories where Num=" & Text_Num.Text.Trim
Dim adp As New SqlDataAdapter(sql, con)
Dim ds As New DataSet
( adp.Fill(ds
If ds.Tables(0).Rows.Count <> 0 Then
(() Dim imageData() As Byte = CType(ds.Tables(0).Rows(0).Item("pic"), Byte
(Dim ms As New IO.MemoryStream(imageData
( PictureBox3.BackgroundImage = Image.FromStream(ms
End If
