using SwanCSharp.DataAccess;
using System;
using System.Collections.Generic;
using System.Data;
using System.Text;

namespace ExportDataToExcel
{
    class Program
    {
        static void Main(string[] args)
        {
            // Open Connection
            DataConnection lobjConnection = new DataConnection("PC-NAME\\INSTANCE_SQL", "DataBase", DatabaseManager.SQLServer);

            //SELECT
            string lstrSQLCommand = "SELECT * FROM Staff";
            DataTable lobjData = lobjConnection.SQLSelectExecute(lstrSQLCommand);

            // Xls
            DataExport.ExportDatabaseToExcel(lobjData, ExcelFormat.Excel, "Test_Xls.xls");
            // Csv
            DataExport.ExportDatabaseToExcel(lobjData, ExcelFormat.CSV, "Test_CSV.xls");
        }
    }
}
