using System;
using System.Collections.Generic;
using System.Windows.Forms;
using System.Data.OleDb;
using System.IO;

namespace Programmatic
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            OleDbConnectionStringBuilder csb = new OleDbConnectionStringBuilder(
                Programmatic.Configuration.Settings.Default.NwindConnectionString);
            /// If connection string specified in application resources points to a non-existant database file
            /// then use a database from a default sample database location.
            if (!File.Exists(csb.DataSource))
            {
                csb.DataSource = 
                    Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Personal),
                     @"ComponentOne Samples\Common\C1NWind.mdb");
                Programmatic.Configuration.Settings.Default["NwindConnectionString"] = csb.ToString();
            }

            
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Form1());
        }
    }
}