Hi Sam,
You need to load the image from the DB, create a file accesible from the
IIS server and then set the ImageUrl property of the image to this new file,
here is the code I'm using:
//First load the image fromt he DB:
SqlCommand cmd = new SqlCommand();
cmd.CommandText = "LoadDocument";
cmd.CommandType = CommandType.StoredProcedure;
cmd.Parameters.Add("@dID", SqlDbType.Int).Value = id;
SqlDataReader reader = DataProvider.ExecuteReader( cmd);
//Now save the file, see that I use a Guid for name the file, as I put all
the files in the same folder it can be possible that two images had the same
name originally.
//This line is to keep a reference of the new name, NOTE that as I use
different kind of files ( not only images) I have to keep the extension of
the file
name = Guid.NewGuid().ToString() + "." + origname.Substring(
origname.LastIndexOf(".")+1);
//Physicalname has the path where the file will be saved
physicalname = physicalname + @"\" + name;
FileStream file = new FileStream( physicalname, FileMode.Create);
file.Write( (byte[])reader["Data"], 0,
((byte[])reader["Data"]).GetUpperBound(0)+1 );
file.Close();
Hope this help,