hi guys,

I am a fresher vb.net programmer. I have a requirement of storing employee's image in databse and retrive them in a form. I could insert image into the database but when I am retriving it , it does not get working. So if anybody knows the code for retriving image from database and displaying in a form , pls let me knw.I am using MS SQL Server 2005 as databse.

My email id is [email]Email Snipped[/email]

regards,

Avinash Karat

Have a look at sample,

Dim dt as New DataTable
            Dim  adp as New SqlDataAdapter("select images from table where id=1","Your_connection_string")
            adp.Fill(dt)
         IF dt.Rows.Count<>0 Then
               Dim buff() as Byte = dt.Rows(0)(0)
             picture1.Image = new Bitmap(new MemoryStream(buff))
        End If
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.