Exemplo n.º 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            var xs = new 学生表();

            xs.学号 = textBox1.Text;
            xs.姓名 = textBox2.Text;
            xs.性别 = textBox3.Text;
//            xs.班级 = textBox4.Text;
            xs.通信地址 = textBox5.Text;
            xs.出生日期 = DateTime.Parse(textBox6.Text);
            xs.身高   = decimal.Parse(textBox7.Text);
            xs.金额   = decimal.Parse(textBox8.Text);
            var mydb = new jiaowudataEntities();

            mydb.学生表.Add(xs);
            mydb.SaveChanges();
            this.Close();
        }