Click here to Skip to main content
15,893,923 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Note :It is a windows application and code i want in using C sharp

when i save export the data grid view items into excel before exporting into excel already excel file is there in c folder that excel to be deleted and save the updated excel file in c folder.

for that how can i write the code.

help me.

Rgds & Thanks
Narasiman
Posted

1 solution

How about:
if(System.IO.File.Exists("c:\\data\\c\\spreadsheet.xlsx"))
{
  System.IO.File.Delete("c:\\data\\c\\spreadsheet.xlsx");
}
// Generate new spreadsheet


Best regards
Espen Harlinn
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900