public void InsertUniversities()
        {
            dataContext.ExecuteCommand("delete from University");

            University MIT = new University();

            MIT.Name = "MIT";
            dataContext.Universities.InsertOnSubmit(MIT);

            University yale = new University();

            yale.Name = "yale";
            dataContext.Universities.InsertOnSubmit(yale);

            dataContext.SubmitChanges();

            MainDataGrid.ItemsSource = dataContext.Universities;
        }
예제 #2
0
        public void InsertUniversities()
        {
            dataContext.ExecuteCommand("delete from University");
            University yale = new University();

            yale.Name = "Yale";
            University cambridge = new University();

            cambridge.Name = "Cambridge";
            dataContext.Universities.InsertOnSubmit(yale);
            dataContext.Universities.InsertOnSubmit(cambridge);
            dataContext.SubmitChanges();
            MainDataGrid.ItemsSource = dataContext.Universities;
        }
        public void InsertUniversities()
        {
            dataContext.ExecuteCommand("delete from University");

            University yale = new University();

            yale.Name = "Yale";
            dataContext.Universities.InsertOnSubmit(yale);

            University beijingTech = new University();

            beijingTech.Name = "Beijing Tech";
            dataContext.Universities.InsertOnSubmit(beijingTech);

            dataContext.SubmitChanges();

            MainDataGrid.ItemsSource = dataContext.Universities;
        }