CZ Stats have been down for a while, but all the bugs are fixed and it should work perfectly. Please take a look at it at
http://www.czstats.com.
First of all you need a field in your database with Image as datatype. Then use this code to show an image:
MemoryStream stream = new MemoryStream();
SqlConnection connection = new SqlConnection(WebConfigurationManager.ConnectionStrings["YourConnection"].ConnectionString);
try
{
connection.Open();
SqlCommand command = new SqlCommand("SELECT [image] FROM tblTable WHERE id = 12345", connection);
byte[] image = (byte[])command.ExecuteScalar();
stream.Write(image, 0, image.Length);
Bitmap bitmap = new Bitmap(stream);
Response.ContentType = "image/gif";
bitmap.Save(Response.OutputStream, ImageFormat.Gif);
}
finally
{
connection.Close();
stream.Close();
}
Good luck. :)