How to generate the data from grid view to excel
My Requirement is
How to generate the data from gridview to excel
i created my datatable
i need to generate the data randomly when i click the button to the excel
below u can find the code
private DataTable GetDetails(int id)
{
_dt = new DataTable();
_da = new SqlDataAdapter("sp_GetDetails", _con);
_da.SelectCommand.Parameters.AddWithValue("@id", id);
_da.SelectCommand.CommandType = CommandType.StoredProcedure;
_dt.Clear();
_da.Fill(_dt);
return _dt;
}
please help me this
Thanks

Leon DRank #851 · 2.6K reputationPosted Aug 29, 2018, 9:04 PM EDT
Aakash MauryaRank #114 · 19.8K reputationPosted Aug 28, 2018, 10:50 PM EDT
Chandan Prasad174 reputationPosted Aug 29, 2018, 8:09 PM EDT