I have a button in a listview that updates a boolean field for the selected record.
The button calls a method (ObsoleteOffice) in my BLL that sets the field (IsObsolete) to true...please see below for the code.
However, the IsObsolete field never gets updated, nor does it throw an error. In addition, the method works with string fields just fine, but nothing happens with the boolean field.
I would be grateful if anyone could shed some light on what I am doing wrong.
public bool ObsoleteOffice(int officeID, bool isObsolete)
offices.OfficesDataTable offices1 = Adapter.GetByOfficeID(officeID);
if (offices1.Count == 0)
// no matching record found, return false
offices.OfficesRow office = offices1;
// office.DateModified = DateTime.Now;
office.IsObsolete = true;
//Update the office record
int rowsAffected = Adapter.Update(office);
//Return true if exactly one row was updated, otherwise false
return rowsAffected == 1;
View Complete Post