Пример #1
0
 private void btnthem_Click(object sender, EventArgs e)
 {
     try
     {
         if (txtmaluat.Text != "" && txtnoidung.Text != "")
         {
             rules l = new rules();
             l.Maluat  = txtmaluat.Text;
             l.Noidung = txtnoidung.Text;
             xl.them(l);
             dataluat.DataSource = xl.loadluat();
             txtmaluat.Text      = "";
             txtnoidung.Text     = "";
         }
         else
         {
             MessageBox.Show("Не оставляйте пустым!");
         }
     }
     catch
     {
         MessageBox.Show("добавить успешно!");
     }
 }
Пример #2
0
        public void sua(rules l)
        {
            String sql = "update tblluat set noidung = N'" + l.Noidung + "' where maluat = '" + l.Maluat + "' ";

            kn.thuchien(sql);
        }
Пример #3
0
        public void them(rules l)
        {
            String sql = "insert into tblluat values('" + l.Maluat + "',N'" + l.Noidung + "')";

            kn.thuchien(sql);
        }