Exemplo n.º 1
0
 private void StatesByYear_Load(System.Object sender, System.EventArgs e)
 {
     // ----- Perform the lookup.
     using (SalesOrderEntities context = new SalesOrderEntities(General.GetConnectionString()))
     {
     }
 }
Exemplo n.º 2
0
        private void StatesByYear_Load(System.Object sender, System.EventArgs e)
        {
            // ----- Perform the lookup.
            using (SalesOrderEntities context = new SalesOrderEntities(General.GetConnectionString()))
            {
                var result = from st in context.StateRegions
                             orderby st.Admitted
                             select new
                {
                    StateName           = st.FullName,
                    AdmitYear           = SqlFunctions.DatePart("year", st.Admitted),
                    TotalAdmittedInYear = AdmittedInYear(st.Admitted)
                };

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