use gridview to excel file
bind your datatable to gridview and export using below mention code.
Response.ClearContent();
Response.AddHeader("content-disposition", "attachment; filename=" + yourfilename);
Response.ContentType = "application/excel";
System.IO.StringWriter sw = new System.IO.StringWriter();
HtmlTextWriter htw = new HtmlTextWriter(sw);
gv.RenderControl(htw);
Response.Write(sw.ToString());
Response.End();