Have a look at this:
Why do I get a "Parameter is not valid." exception when I read an image from my database?[
^] - dont' worry about the name, it explains how not to do it, then covers the code to do it properly.
Retrieving them is (generally) pretty trivial as well:
using (SqlConnection con = new SqlConnection(GenericData.DBConnection))
{
con.Open();
using (SqlCommand cmd = new SqlCommand("SELECT ImageData FROM Images WHERE Id=@ID", con))
{
cmd.Parameters.AddWithValue("@ID", Id);
SqlDataReader r = cmd.ExecuteReader();
if (r.Read())
{
MemoryStream ms = new MemoryStream((byte[])r["ImageData"]);
MyImage = Image.FromStream(ms);
}
}
}
You can then use MyImage in your application via whatever control you require.