Friday, 2 October 2015

Export Datagridview to Excel in VS 2012 DataSet ds=new DataSet(); ds=LoadData(qry);             // creating Excel Application             Microsoft.Office.Interop.Excel._Application app = new Microsoft.Office.Interop.Excel.Application();             // creating new WorkBook within Excel application             Microsoft.Office.Interop.Excel._Workbook workbook...

VS 2008 Exporting Datagrid to Excel

Befor that add Microsoft.Office.Interop.Excel dll in reference if (dataGridView1.Rows.Count > 0)             {                 Microsoft.Office.Interop.Excel.ApplicationClass XcelApp = new Microsoft.Office.Interop.Excel.ApplicationClass();                 XcelApp.Application.Workbooks.Add(Type.Missing);                ...