how to export data to Excel from SqlDataReader
hi,
i want to export data to excel file/format. i used StreamWriter class as follows:
System.IO.FileInfo info = new System.IO.FileInfo("c:\data.xls");
System.IO.StreamWriter writer = info.AppendText();
now whatever i write to file using writer.Write()/ writer.WriteLine(), is not individually placed in excel cell, but
are placed as a whole sentence.
how can i get my individual items to individual excell cell?
please help.
Arif.
Note: if i carete file with .cs extension then i achieve my goal but i want to understand the real phenomenon of
data export to .xls file.
|