Exemplo n.º 1
0
        private void Form1_Load(object sender, EventArgs e)
        {
            var sales = dc.Sales_by_Year(new DateTime(1990, 1, 1), new DateTime(2000, 1, 1));
            saleGrid.DataSource = sales;

            var q = from c in dc.Customers select new { c.CustomerID, c.CompanyName };

            dataGridView1.DataSource = q;
        }
Exemplo n.º 2
0
        /// <summary>
        /// Stored Procedure:  Sales By Year
        /// </summary>
        /// <param name="beginningYear"></param>
        /// <param name="endingYear"></param>
        /// <returns></returns>
        public static List <Sales_by_YearResult> SalesByYear(DateTime?beginningYear,
                                                             DateTime?endingYear)
        {
            NorthwindDataContext dc = new
                                      NorthwindDataContext();

            return(dc.Sales_by_Year(beginningYear,
                                    endingYear).ToList <Sales_by_YearResult>());
        }