Posts

Showing posts with the label export

Export datatable data in Excel

Hi to all. Normally we work in database but some time we need reporting or get data in soft copy to send email or for record purpose. So we export data in excel file.hear i show you how to export data from datatable . first get data from database to in datatable which we show in starting session. I genrate one function that help to export in Excel .   public bool DatatabletoExcel(DataTable Dt)         {             bool result = false;             try             {                 //create dialog for create file                 SaveFileDialog sfd = new SaveFileDialog();                 sfd.FileName = "File Name";                 sfd.DefaultExt = "xls";                ...