public Processor(Options options) { var asm = Assembly.GetExecutingAssembly(); _location = Path.GetDirectoryName(asm.Location); if (options.UserName == null || options.password == null) { _connectionString = string.Format("Server={0};Database={1};Trusted_Connection=True", options.Server, options.Database); } else { _connectionString = string.Format("Server={0};Database={1};User Id={2};Password={3}", options.Server, options.Database,options.UserName,options.password); } }
static void Main(string[] args) { var options = new Options(); if (CommandLine.Parser.Default.ParseArguments(args, options)) { List<int> eventRange = rangeParser.ParseRange(options.Range); Console.WriteLine(string.Format("Retrieving events {0} to {1}", eventRange.Min(), eventRange.Max())); var p = new Processor(options); p.ConnectionValid(); if (options.Operation.ToUpper() == "DROP") { p.CreateObjects(); } p.LoadData(eventRange); Console.WriteLine("Press Any Key"); Console.ReadKey(); } }