Exemplo n.º 1
0
 private void button5_Click(object sender, EventArgs e)
 {
     try
     {
         RRabot   rr  = new RRabot();
         Met2     d   = new Met2();
         string[] str = comboBox2.Items[comboBox2.SelectedIndex].ToString().Split(new char[] { ' ' });
         d.ADD(RRabot.IDRabot, Convert.ToInt32(str[0]));
         this.Close();
     }
     catch (ArgumentOutOfRangeException) { MessageBox.Show("Не все поля заполнены"); }
     catch { MessageBox.Show("Error"); }
 }
Exemplo n.º 2
0
 private void button1_Click(object sender, EventArgs e)
 {
     try
     {
         Met2     d   = new Met2();
         string[] str = comboBox1.Items[comboBox1.SelectedIndex].ToString().Split(new char[] { ' ' });
         //Подключаемся к БД
         String connectionString = kursach.Program.Pole.pole;
         //  Создать новый адаптер данных на основе указанного запроса.
         dataAdapter = new SqlDataAdapter("SELECT @@IDENTITY AS 'Identity'", connectionString);
         d.ADD(Convert.ToInt32(temp), Convert.ToInt32(str[0]));
         this.Close();
     }
     catch (ArgumentOutOfRangeException) { MessageBox.Show("Не все поля заполнены"); }
     catch { MessageBox.Show("Error"); }
 }