Related to ExecuteNonquery(); , it will return the no of rows affected, so it will "1" if your query worked in database else "0" if query failed due to any reasons.
Here, you can cross check whether user.Id is initialised or not before coming to this block