Click here to Skip to main content
12,397,480 members (60,833 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: C#
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 30-Jan-13 0:51am

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

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
  Permalink  

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160721.1 | Last Updated 30 Jan 2013
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100