Hello. Have a situation in which the user may not have or know the jurisdiction and not able to enter it when adding a new company. I currently have the following code for the insert and update of the field. But I need to have it enter zero if nothing selected. The field in the table is not a FK and does allow null. I would prefer zero over null. I suspect it has something to do with the part that ends .Equals(0). The combobox will always have the jurisdictions listed in it. What do I need to remove or add to this line?
Thanks...John
command.Parameters.AddWithValue("@jurisdictionid", !cboJurisdictionID.Items.Count.Equals(0) ? cboJurisdictionID.SelectedValue : 0);