private void txtBienSo_Validating(object sender, CancelEventArgs e) { if (blXe.CheckLicensePlate(txtBienSo.Text).Tables[0].Rows.Count != 0) { errorProvider1.SetError(txtBienSo, "Biển số này đã được sử dụng!"); check = false; } else { errorProvider1.SetError(txtBienSo, null); check = true; } }