i have a problem of my codes in saving and retrieving image in sql sever 2008 using visual studio 2008. honestly im not good in programming but i want to learn just for my project in my subject. is anyone there good in programming can solve my problem? thanks!
here is my code.. if anyone can check this codes kindly help me.. thanks
Private Sub attchpixbtn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles attchpixbtn.Click If OpenFileDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then pixbox.ImageLocation = OpenFileDialog1.FileName End If End Sub
conn.Close() DBconnect() Dim RST As New ADODB.Recordset If RecView.SelectedItems.Count = 0 Then MsgBox("select item to view") Exit Sub End If RST.Open("SELECT * FROM records WHERE Id='" & RecView.SelectedItems(0).Text & "'", conn, 1, 4, ) Try PictureBox1.Image = (RST.Fields("pix").Value) Catch MsgBox("image opened") End Try RST.Close() End Sub
This post has been edited by macosxnerd101: 26 February 2011 - 11:12 AM
Reason for edit:: Please use code tags