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



code to generate a excel sheet and to write data into it --- -it has to fetch the excel sheet whic..

Answer / 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

More C Sharp Interview Questions

What is lazy loading entity framework?

0 Answers  


How does c# generics and c++ templates compare?

0 Answers  


What is the use of console readkey ()?

0 Answers  


Explain the feature of c# language?

0 Answers  


What is the difference between String s(Small s) and String S(Capital S)?

4 Answers  






Is comparator a functional interface?

0 Answers  


What is a collection class in c#?

0 Answers  


What is datetime minvalue in c#?

0 Answers  


How do you set a class path?

0 Answers  


What is a generic c#?

0 Answers  


What are c# types?

0 Answers  


what is a structure in c#

0 Answers   Cognizant,


Categories