Код: Выделить всё
ClientClass client = new ClientClass
{
ClientName = txtClientName.Text,
Address = txtAddress.Text,
Address2 = txtAddress2.Text,
City = cbxCity.Text,
State = cbxState.Text,
ZipCode = cbxZip.Text,
Phone = txtPhone.Text,
Fax = txtFax.Text,
AccountManager = cbxAcctManager.Text,
EmailDomain = txtEDomain.Text,
EmailFormat = cbxEMFormat.SelectedValue.ToString(),
};
Я пробовал добавить
Код: Выделить всё
if (cbxCity.SelectedValue == null)
{
MessageBox.Show("Null");
cbxCity.Text = "";
cbxState.Text = "";
cbxZip.Text = "";
cbxEMFormat.Text = "";
cbxAcctManager.Text = "";
MessageBox.Show(cbxCity.Text);
}
Я просто хочу, чтобы сохранение прошло, даже если выбор не сделан сделал.
Спасибо
Подробнее здесь: https://stackoverflow.com/questions/784 ... to-be-null
Мобильная версия