private void StatesByYear_Load(System.Object sender, System.EventArgs e)
        {
            // ----- Perform the lookup.
            using (SalesOrderDataContext context = new SalesOrderDataContext(General.GetConnectionString()))
            {
                var result = from st in context.StateRegions
                             where st.Admitted != null
                             orderby st.Admitted.Value.Year
                             select new
                {
                    StateName           = st.FullName,
                    AdmitYear           = st.Admitted.Value.Year,
                    TotalAdmittedInYear = context.AdmittedInYear(st.Admitted)
                };

                StateAdmittance.DataSource = result.ToList();
            }
        }
 private void OrderViewer_Load(System.Object sender, System.EventArgs e)
 {
     // ----- Open the context to the set of customer orders.
     OrderContext = new SalesOrderDataContext(General.GetConnectionString());
 }