I'm using .Net 1.1 and Sql Server database.
I have a situtation where a combo box is bound to a dataset and will quite happily update the column when the user changes the value.
The default value for the field is null. In this case the field is a Country ID code and has a foreign key on a country table.
I only want the user to populate the country field when the country is foreign. If the user has populated incorrectly I want to remove the setting i.e. reset it to null.
I have a empty string option in the combo (although this is not a valid foreign key) and when the user selects to save the record if the empty string is selected I set the combo.Text field to null.
The problem is if I use the normal update methods (System.Data.DataRowState.Modified) the dataset does not recognise this as a change.
I could put special code in to update the table directly with Sql but this does seem unnecessary. There must be an easy way.
It's not a problem with the database as I can quite happily set the the field to null, it's simply not recognising the column has changed and must be set to null - somehow.
Any ideas ?
I have a situtation where a combo box is bound to a dataset and will quite happily update the column when the user changes the value.
The default value for the field is null. In this case the field is a Country ID code and has a foreign key on a country table.
I only want the user to populate the country field when the country is foreign. If the user has populated incorrectly I want to remove the setting i.e. reset it to null.
I have a empty string option in the combo (although this is not a valid foreign key) and when the user selects to save the record if the empty string is selected I set the combo.Text field to null.
The problem is if I use the normal update methods (System.Data.DataRowState.Modified) the dataset does not recognise this as a change.
I could put special code in to update the table directly with Sql but this does seem unnecessary. There must be an easy way.
It's not a problem with the database as I can quite happily set the the field to null, it's simply not recognising the column has changed and must be set to null - somehow.
Any ideas ?