using System;
using System.Collections.Generic;
using System.Text;
using System.Reflection;
using Excel = Microsoft.Office.Interop.Excel;
namespace ConsoleApplication18
{
class Program
{
static void Main(string[] args)
{
ExportDataToExcel("server=(local);uid=sa;pwd=sqlgis;database=master",
"select * from sysobjects",@"c:\testADO.xls","sysobjects");
}