I have changed the Sql statement ..where clause is gone,I have got the image but not according to the name,just one picture is showing no matter which row I click .
Code:Dim connection As New SqlConnection("Data Source=.\SQLEXPRESS;AttachDbFilename=C:\Users\Danial\documents\visual studio 2010\Projects\ESI_PF_Payroll_V1\ESI_PF_Payroll_V1\Pay.mdf;Integrated Security=True;Connect Timeout=30;User Instance=True") connection.Open() Dim command As New SqlCommand("SELECT Imagedata FROM Employee ", connection) Dim pictureData As Byte() = DirectCast(command.ExecuteScalar(), Byte()) connection.Close() Dim picture As Image = Nothing 'Create a stream in memory containing the bytes that comprise the image. Using stream As New IO.MemoryStream(pictureData) 'Read the stream and create an Image object from the data. picture = Image.FromStream(stream) frm.PB1.Image = (picture) End Using




Reply With Quote