DataTable导入到Excel文件

DataTable导入到Excel文件
    ;
                saveFileDialog.RestoreDirectory = ;
            , intIndex] = column.ColumnName;
            }

; i < rowCount; i++)
            {
                ; j < colCount; j++)
                {
                    , colCount]).Value2 = dataArray;
            sheet.SaveAs(fileName, miss, miss, miss, miss, miss, Microsoft.Office.Interop.Excel.XlSaveAsAccessMode.xlNoChange, miss, miss, miss);

book.Close(false, miss, miss);
            books.Close();
            excel.Quit();

//System.Runtime.InteropServices.Marshal.ReleaseComObject();   
            System.Runtime.InteropServices.Marshal.ReleaseComObject(sheet);
            System.Runtime.InteropServices.Marshal.ReleaseComObject(book);
            System.Runtime.InteropServices.Marshal.ReleaseComObject(books);
            System.Runtime.InteropServices.Marshal.ReleaseComObject(excel);
            GC.Collect();
            return true;

}

上一篇:UILabel设定行间距方法


下一篇:Android APP性能优化(最新总结)