Iam creating a web page for uploading & displaying an image from database..
my images are inserting perfectly in byte format into database,
and display images is also working well,
here my problem is when you upload a new image, it is displaying the same old image,
here's my code for displaying a image from database on click of display button..
SqlConnection connection = new SqlConnection(ConfigurationManager.AppSettings["connstring"]);
SqlCommand command = new SqlCommand("SELECT * from [Imagetab]", connection);
SqlDataAdapter da = new SqlDataAdapter(command);
DataSet ds = new DataSet();
da.Fill(ds);
Image1.ImageUrl = "ImageHandler.ashx?ImageID='" + ds.Tables[0].Rows[0][0].ToString() + "'";
Image1.Visible = true;
here i am using an image handler, and the code is as below..
string imageid = context.Request.QueryString["ImageID"].ToString();
if (imageid != null)
{
cmd.CommandText = "select ImageName from Imagetab where ImageID=" + imageid + "";
cmd.Connection = con;
con.Open();
bytImage = (byte[])(cmd.ExecuteScalar());
con.Close();
context.Response.BinaryWrite(bytImage);
}
here, i cant understand, how to clear the cache or how to get new uploaded images,
any help will be thankful..