My datatable has 0123 when I export it becomes 123,Datatable can be numeric or alphanumeric,after searching I got this link
http://aspforums.net/Threads/109827/maintaining-leading-zeros-when-exporting-to-excel/
I didnt managed to use your code in DataTable.
My Code.
dtExport is my DataTable
DataGrid dGrid = new DataGrid();
dGrid.DataSource = dtExport;
dGrid.DataBind();
StringWriter sw = new StringWriter();
HtmlTextWriter hw = new HtmlTextWriter(sw);
dGrid.RenderControl(hw);
Response.ContentType = "application/x-msdownload";
Response.AppendHeader("Content-Disposition", "attachment; filename=SalesTarget.xls");
this.EnableViewState = false;
Response.Write(sw.ToString());
Response.End();
HttpContext.Current.ApplicationInstance.CompleteRequest();