Hi Mahesh
In my code write a query for picking values which you want and export them to excel.
string str = "your Query";
ds = da.fill_data(str);
DataTable dt = new DataTable();
dt = ds.Tables[0];
string attachment = "attachment; filename=ABC.xls";
Response.ClearContent();
Response.AddHeader("content-disposition", attachment);
Response.ContentType = "application/vnd.ms-excel";
string tab = "";
foreach (DataColumn dc in dt.Columns)
{
Response.Write(tab + dc.ColumnName);
tab = "\t";
}
Response.Write("\n");
int i;
foreach (DataRow dr in dt.Rows)
{
tab = "";
for (i = 0; i < dt.Columns.Count; i++)
{
Response.Write(tab + dr[i].ToString());
tab = "\t";
}
Response.Write("\n");
}
Response.End();
make as answer if it helps You.