I am trying to save a DataTable to an Excel worksheet ... my code is as follows ..
Excel.Range range = xlWorkSheet.get_Range("A2"); range = range.get_Resize(dtExcel.Rows.Count, dtExcel.Columns.Count); object[,] rng1 = new object[dtExcel.Rows.Count, dtExcel.Columns.Count];
An Excel range requires a range value in the form of an array [,], but I have a DataTable in the form of a gear array [] [].
object[][] rng2 = dtExcel.AsEnumerable().Select(x => x.ItemArray).ToArray();
Is there a built-in function for directly converting a gear array [] [] into a two-dimensional array [] []? Excel iterations, DataTable and assignment seem slower with bulk data.
Also I do not want to configure queries with DSN for Excel. I chose the Excel repository to avoid setting up any databases ..: P I found a detailed explanation of how to write data to succeed here .. http://support.microsoft.com/kb/306023
source share