I have modified code to get all columns and merged into sheet acceding to your requirements. Check the code, hope you will get your desired output.
Microsoft.Office.Interop.Excel.Application xlApp;
Microsoft.Office.Interop.Excel._Workbook xlWorkBook;
Microsoft.Office.Interop.Excel._Worksheet xlWorkSheet;
xlApp = new Microsoft.Office.Interop.Excel.Application();
xlWorkBook = (Microsoft.Office.Interop.Excel._Workbook)(xlApp.Workbooks.Add(""));
xlWorkSheet = (Microsoft.Office.Interop.Excel._Worksheet)xlWorkBook.ActiveSheet;
int rowIndex = 2, colIndex = 1, actualIndex = 1;
for (int i = 0; i < resultDS.Tables.Count; i++)
{
rowIndex = 2;
colIndex = 1;
if (i > 0)
actualIndex += resultDS.Tables[i - 1].Columns.Count;
foreach (DataRow row in resultDS.Tables[i].Rows)
{
colIndex = actualIndex;
for (int k = 0; k < resultDS.Tables[i].Columns.Count; k++)
{
if(rowIndex == 2)
xlWorkSheet.Cells[rowIndex-1, colIndex]= resultDS.Tables[i].Columns[k].ColumnName;
xlWorkSheet.Cells[rowIndex, colIndex] = row[resultDS.Tables[i].Columns[k]];
colIndex++;
}
rowIndex++;
}
}
xlWorkBook.SaveAs("YourPath\dtEmployee.xls", Microsoft.Office.Interop.Excel.XlFileFormat.xlWorkbookDefault, Type.Missing, Type.Missing,
false, false, Microsoft.Office.Interop.Excel.XlSaveAsAccessMode.xlNoChange,
Type.Missing, Type.Missing, Type.Missing, Type.Missing, Type.Missing);
xlWorkBook.Close();
xlApp.Quit();