can you correct my code where i have place the code for displaying default image from folder images
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.
Jaish MathewsRank #225 · 11K reputationPosted May 11, 2010, 11:08 AM EDT
0
Hi,
You can check here.
object img = cmd.ExecuteScalar(); Take care that MemmoryStream needs to be taken care in different manner.
if(img == null)
{
System.Drawing.Image b = new System.Drawing.Bitmap(@"C:\f.gif");
MemoryStream ms = new MemoryStream();
b.Save(ms, System.Drawing.Imaging.ImageFormat.Gif);
Jaish MathewsRank #225 · 11K reputationPosted May 11, 2010, 11:08 AM EDT
You can check here.
object img = cmd.ExecuteScalar();
Take care that MemmoryStream needs to be taken care in different manner.
if(img == null)
{
System.Drawing.Image b = new System.Drawing.Bitmap(@"C:\f.gif");
MemoryStream ms = new MemoryStream();
b.Save(ms, System.Drawing.Imaging.ImageFormat.Gif);
Response.OutputStream.Write(ms.ToArray(), 0, Int16.Parse( ms.Length.ToString()));
}