i am using below but it asked for the save option.
ds = new DataSet();
ds = sq.ExecuteDataSet("Filllresult1", param);
if ((ds != null) && (ds.Tables.Count != 0) && (ds.Tables[0].Rows.Count != 0))
{
HttpResponse response = HttpContext.Current.Response;
response.Clear();
//response.Charset = "";
response.ContentType = "application/vnd.ms-excel";
response.AddHeader("Content-Disposition", "attachment;filename=Smarks.xls");
//string filename = "Mark" + p;
//response.AddHeader("Content-Disposition", "C:\"" + fileName + "\"");
StringWriter sw = new StringWriter();
HtmlTextWriter htw = new HtmlTextWriter(sw);
DataGrid dg = new DataGrid();
dg.DataSource = ds;
dg.DataBind();
dg.RenderControl(htw);
response.Write(sw.ToString());
response.End();
}