public void Xoa(LoaiDuAn_InFo loaiduan) { SqlCommand s = new SqlCommand("Delete LoaiDuAn where MaLoaiDuAn = @ma"); s.Parameters.Add("@ma", SqlDbType.Int).Value = loaiduan.MaLoaiDuAn; DT_SV.Load(s); }
public void Sua(LoaiDuAn_InFo loaiduan) { SqlCommand s = new SqlCommand("Update LoaiDuAn set TenLoaiDuAn = @ten where MaLoaiDuAn = @ma"); s.Parameters.Add("@ten", SqlDbType.NVarChar, 50).Value = loaiduan.TenLoaiDuAn; s.Parameters.Add("@ma", SqlDbType.Int).Value = loaiduan.MaLoaiDuAn; DT_SV.Load(s); }
public void Them(LoaiDuAn_InFo loaiduan) { SqlCommand s = new SqlCommand("INSERT INTO LoaiDuAn(MaLoaiDuAn, TenLoaiDuAn) VALUES(@ma, @ten)"); s.Parameters.Add("@ma", SqlDbType.Int).Value = loaiduan.MaLoaiDuAn; s.Parameters.Add("@ten", SqlDbType.NVarChar, 50).Value = loaiduan.TenLoaiDuAn; DT_SV.Load(s); }