Delete image from Folder/Database using RowCommand/RowDeleting events
<p>I am uploading images and display them in a <code>Gridview</code>.I save the images in a folder and the name in the database.Now I want if I uploaded 3 pictures and have to delete one which I select.So I have picture 1 2 3. When I select picture 2 than this will be deleted..How can I do that? This is my code to upload my pictures:</p>

<pre><code>string filename = Path.GetFileName(fileuploadimages.PostedFile.FileName);
fileuploadimages.SaveAs(Server.MapPath("Images/" + filename));

SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["baza_chestionar"].ToString());
con.Open();

SqlCommand cmd = new SqlCommand("Insert into Images(ImageName,ImagePath) values(@ImageName,@ImagePath)", con);
cmd.Parameters.AddWithValue("@ImageName", filename);
cmd.Parameters.AddWithValue("@ImagePath", "Images/" + filename);
cmd.ExecuteNonQuery();

con.Close();
Response.Redirect("~/upload.aspx");
</code></pre>
