string [,] arrayLast=new string[rowCount,coulumnCount];
colIndex = 0;
rowIndex=0;
try
{
foreach(DataRow row in table.Rows)
{
foreach(DataColumn col in table.Columns)
{
arrayLast[rowIndex,colIndex]=row[col.ColumnName].ToString();
colIndex++;
}
rowIndex++;
colIndex = 0;
}
}
catch(Exception ex)
{
MessageBox.Show(ex.Message);
}
Excel.Range dataRangeLast=excelWorkSheetLast.get_Range(excelWorkSheetLast.Cells[2,1],excelWorkSheetLast.Cells[rowCount+1,coulumnCount]);
dataRangeLast.Value2=arrayLast;