here\'s the deal I got a datagridviewer which is called gridview1 and a fileupload1 when i upload a file it updates the gridview1 and table in database with the file name and pa
This is how I delete files
if ((System.IO.File.Exists(fileName)))
{
System.IO.File.Delete(fileName);
}
Also make sure that the file name you are passing in your delete, is the accurate path
EDIT
You could use the following event instead as well or just use the code in this snippet and use in your method
void GridView1_SelectedIndexChanged(Object sender, EventArgs e)
{
// Get the currently selected row using the SelectedRow property.
GridViewRow row = CustomersGridView.SelectedRow;
//Debug this line and see what value is returned if it contains the full path.
//If it does not contain the full path then add the path to the string.
string fileName = row.Cells[0].Text
if(fileName != null || fileName != string.empty)
{
if((System.IO.File.Exists(fileName))
System.IO.File.Delete(fileName);
}
}