I'm not quite sure what asp.net has to do with a console application ... if you wish to write your output to a file that can be read by excel, then, something like this
using (System.IO.StreamWriter fileOutput =
new System.IO.StreamWriter(@"C:\Some Path\sudhakarthikeyan.csv"))
{
while (reader.Read()
{
fileOutput.WriteLine("{0},{1},{2},{3},{4}",
reader.GetInt32(0),
reader.GetString(1),
reader.GetString(2),
reader.GetString(3),
reader.GetString(4);
}
}
Now, if you're running from ASP.Net instead of 'a console application', you'll need to replace
C:\Some Path
With a 'mapped path', ie a valid path on your web site. This
http://www.dotnetperls.com/mappath[
^] may be a reference for how to start
There are also other tools that might be useful -
FileHelpers Library[
^] for instance