コード例 #1
0
        private void Button_Click_1(object sender, RoutedEventArgs e)
        {
            Student st = new Student();
            st.stuId = int.Parse(idtxt.Text);
            st.stuName = nametxt.Text;
            st.age = int.Parse(agetxt.Text);
            st.image = imagelbl.Text;
            st.deptID = (int)cmb1.SelectedValue;

            stdDataClasses1DataContext std = new stdDataClasses1DataContext();
            std.Students.InsertOnSubmit(st);
            std.SubmitChanges();
            MessageBox.Show("Added succesfully....!");
            listbox1.ItemsSource = std.Students;
            cmb1.ItemsSource = std.Departments;
        }
コード例 #2
0
 partial void DeleteStudent(Student instance);
コード例 #3
0
 partial void UpdateStudent(Student instance);
コード例 #4
0
 partial void InsertStudent(Student instance);
コード例 #5
0
		private void detach_Students(Student entity)
		{
			this.SendPropertyChanging();
			entity.Department = null;
		}
コード例 #6
0
		private void attach_Students(Student entity)
		{
			this.SendPropertyChanging();
			entity.Department = this;
		}