Save/Edit picturebox image to sql server 2005 database

I have a form with an opendialog1 that browses for a picture and then displays it in picturebox1. That part works. I use a sqlserver database with a Pic table with 3 columns: IndividualID, Name, and Picture.  I would like to know how to write the code that copies the picturebox image to the Picture column in a binary memorystream and save it.  I then need the saved picture to display back in Picturebox1 whenever that row is selected in a DataGridView.  Also need to be able to delete the image and change it to another.  I have used the wizard to set up the Select, Insert and Delete statements.  I have made the database diagram and linked the tables together.  Each row in the database contains info about an individual and their picture.  I need help with the code for a save button to move the image file to the dataset, and a delete button to remove it if needed.  On a row select change I need the picturebox image to change to that of the current individual listed.

Any help would be appreciated.



Answer this question

Save/Edit picturebox image to sql server 2005 database

  • andyk93

    A response to this post would help me alot as well. Can't seem to find any information helpfull enough to make it happen.. I'll post the solution here if I come across it.

  • Save/Edit picturebox image to sql server 2005 database