السلام عليكم
ارجوا مساعدتي في كود استرجاع الصورة في في تصميم البرنامج التالي
صورة البرنامج وكل شي يعمل تمام حتى استرجاع النصوص ضابط معي المشكلة في استرجاع الصورة تظهر لي رسالة
صورة واجهة البرنامج
الصورة الثانية لرسالة الخطلأ
الصورة الثالثة لقاعد البيانات
ثم اكواد البرنامج



Public Class Form1
Dim conn As New OleDbConnection
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
conn.ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + IO.Directory.GetCurrentDirectory + "\arseef.accdb"
Timer1.Enabled = True
Timer1.Interval = 1000
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
conn.Open()
Try
Dim cmdinsert As New OleDbCommand
cmdinsert.Connection = conn
cmdinsert.CommandText = "insert into arsh values ('" + TextBox1.Text + "','" + TextBox2.Text + "','" + TextBox3.Text + "','" + TextBox4.Text + "','" + PictureBox1.Name + "')"
cmdinsert.ExecuteNonQuery()
MsgBox("تم اضافة المعاملة بنجاح")
TextBox1.Clear()
TextBox2.Clear()
TextBox3.Clear()
TextBox4.Clear()
PictureBox1.Image = Nothing
Catch ex As Exception
MsgBox(ex.Message.ToString)
End Try
conn.Close()
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
conn.Open()
Try
Dim cmdselect As New OleDbCommand
cmdselect.Connection = conn
cmdselect.CommandText = "select * from arsh where numm = '" + TextBox1.Text + "' OR subj = '" + TextBox2.Text + "'"
Dim re As OleDbDataReader
re = cmdselect.ExecuteReader
If re.Read Then
TextBox1.Text = re(0).ToString
TextBox2.Text = re(1).ToString
TextBox3.Text = re(2).ToString
TextBox4.Text = re(3).ToString
PictureBox1.Name = Name("pic").ToString
Else
MsgBox("عفواً لاتوجد معاملة بهذا الرقم")
End If
Catch ex As Exception
MsgBox(ex.Message.ToString)
End Try
conn.Close()
End Sub
Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
OpenFileDialog1.Filter = "image file (*.jpg, *.bmp, *.png) | *.jpg; *.bmp; *.png| all files (*.*) |*.*"
If OpenFileDialog1.ShowDialog <> Windows.Forms.DialogResult.Cancel Then
PictureBox1.Image = Image.FromFile(OpenFileDialog1.FileName)
End If
End Sub
Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
TextBox1.Clear()
TextBox2.Clear()
TextBox3.Clear()
TextBox4.Clear()
PictureBox1.Image = Nothing
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
Hide()
Form2.Show()
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Label5.Text = Microsoft.VisualBasic.TimeOfDay
End Sub
Private Sub OpenFileDialog1_FileOk(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles OpenFileDialog1.FileOk
End Sub
End Class