code to generate a excel sheet and to write data into it ---
-it has to fetch the excel
sheet which is in one folder placed by us inside a project
folder(i,e it has to create a instance of that excel sheet)
and write the data into it row by row please respond as
early as possible

Answer Posted / uiky

string outputFile1 = "C:\\abc.xls";

FileInfo outputFileInfo1 =
new FileInfo(outputFile1);
FileStream outfs1 = null;
if(outputFileInfo1.Exists)
outfs1 =
outputFileInfo1.Open(FileMode.Open);
else
outfs1 =
outputFileInfo1.Open(FileMode.CreateNew);
TextWriter tw1 = new
StreamWriter(outfs1);

Is This Answer Correct ?    3 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Define strong name in c#?

513


If you want to write your own dot net language, what steps you will u take care?

552


what is a static constructor?

664


Is as operator in c#?

465


Why do we use polymorphism in c#?

468






Is c# difficult to learn?

475


How does foreach loop work in c#?

477


How do I create a multilanguage, single-file assembly?

490


What does args mean in c#?

490


What is decimal in c#?

497


Can we override static class in c#?

475


Is c# still popular?

483


What is data quality assurance?

441


How to override a function in c#?

537


Why should you override the tostring() method?

586