منتدى فيجوال بيسك لكل العرب | منتدى المبرمجين العرب

نسخة كاملة : مشاهدة الصورة من قاعدة البيانات
أنت حالياً تتصفح نسخة خفيفة من المنتدى . مشاهدة نسخة كاملة مع جميع الأشكال الجمالية .
اريد عند الضغط علي الصف بية الصور بقاعدة البيانات  نقل ومشاهدة الصورة بداخل الخلية الي    PICTUREBOX

انا حاولت بالطريقة دية هيا بشتغل بيها لنقل قيم الخلايا الي تيكست بوكس لتعديل  عمود الصور رقم 3

ظهر الخطا التالي  Object reference not set to an instance of an object.

كود :
 Dim indx = DataGridView1.CurrentRow.Index
       DataGridView1.Rows(indx).Selected = True
       DataGridView1.FirstDisplayedScrollingRowIndex = indx
       product1_add.Label8.Text = DataGridView1(0, indx).Value.ToString()
       product1_add.TextBox1.Text = DataGridView1(1, indx).Value.ToString()
       product1_add.TextBox2.Text = DataGridView1(2, indx).Value.ToString()
       Dim stream As New MemoryStream()
       con.Open()
       Dim command As New OleDbCommand("select image_TB1 from TB1", con)
       Dim image As Byte() = DirectCast(command.ExecuteScalar(), Byte())
       stream.Write(image, 0, image.Length)
       con.Close()
       Dim bitmap As New Bitmap(stream)
       product1_add.PictureBox1.Image = bitmap
اتفضل اخي
PHP كود :
       Dim DT As New DataTable
        DT
.Clear()
 
       Dim ADP As New OleDbDataAdapter("select image_TB1 from TB1"CON)
 
       ADP.Fill(DT)
 
       Dim PIC_() As Byte CType(DT.Rows(DT.Rows.Count 1).Item("image_TB1"), Byte())
 
       Dim MS As New MemoryStream(PIC_)
 
       product1_add.PictureBox1.Image Image.FromStream(MS
لو كل صورة ليها رقم لازم تكمل جملة SELECT 
......................WHERE "NAME_COL" LIKE
(09-02-18, 12:49 AM)محمود صالح كتب : [ -> ]اتفضل اخي
PHP كود :
       Dim DT As New DataTable
        DT
.Clear()
 
       Dim ADP As New OleDbDataAdapter("select image_TB1 from TB1"CON)
 
       ADP.Fill(DT)
 
       Dim PIC_() As Byte CType(DT.Rows(DT.Rows.Count 1).Item("image_TB1"), Byte())
 
       Dim MS As New MemoryStream(PIC_)
 
       product1_add.PictureBox1.Image Image.FromStream(MS
لو كل صورة ليها رقم لازم تكمل جملة SELECT 
......................WHERE "NAME_COL" LIKE

انا لقيت كود قريب من كودك بموقع اجنبي قبل طرح الموضوع ولكن المشكلة في الجزء التالي يظهر الخطا EXPRESSION DOES NOT PRODUCE A VALUE

  ما الحل لتلك المشكلة
PHP كود :
Image.FromStream(MS)' image EXPRESSION DOES NOT PRODUCE A VALUE 
ضع المثال افضل