예제 #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            sweetEntities MojModel = new sweetEntities();
            Smak          mojSmak  = new Smak();

            mojSmak.NazwaSmaku = textBox1.Text;
            MojModel.SmakSet.Add(mojSmak);
            MojModel.SaveChanges();
        }
예제 #2
0
        private void button2_Click(object sender, EventArgs e)
        {
            sweetEntities MojModel = new sweetEntities();

            dataGridView1.DataSource = MojModel.SmakSet.OrderBy(k => k.idSmak).ToList();
        }