I just took over a project from a developer who has already left an organisation and I'm doing some maintenance work in the project. I can see the following code in a custom web part
CurrentUserInfo CurrentUser = MembershipContext.AuthenticatedUser;
DateTime ExpirationDate = CurrentUser.GetValue("aps_expirationdate", DateTime.Now);
The strange thing is, I cannot seem to find this custom field 'aps_expirationdate' anywhere in the system or in the database.
I checked the following places but couldn't find it.
but I cannot seem to find this column anywhere and the other strange thing is, when I debug the code it does return a date value. No bugs in the code so, cannot say that this is an invalid column name. Where else should I look?
Based on what you've put in your initial question, it sounds as if the column was added manually and not through the Kentico UI. In order for the data access layer or the Kentico API to know that field exists, the definition has to be stored within the Kentico module class and not just in the database.
Here's what I'd do to correct this:
CMS_User
or CMS_UserSetting
table.CMS_User
or CMS_UserSetting
table, then go to the Modules app in the Kentico UI.aps_expirationdate
field.aps_expirationdate
in the other table, write a query to copy it from the other table to the CMS_User
table.If the field is already in the CMS_User
or CMS_UserSetting
table, then you will have to do the following:
aps_expirationdate_old
.aps_expirationdate
field.aps_expirationdate_old
field in the CMS_User
or CMS_UserSetting
table, write a query to copy it from the other table to the CMS_User
table.Your last bullet point states you "Did a manual Sql Search in the database to find a table with a column name 'aps_expirationdate'". This contradicts what you state at the end of your question which states "I cannot seem to find this column anywhere". If you cannot find what table the aps_expirationdate
exists in, then check out the following SO answer to find that column in a given database.