Ronald wrote
not really since the fields are dynamically generated and given an ID i cant check the field against a database value because of that. i already hardcoded another textbox in with a fixed ID and got it to check its value in a database but i dont know how to let it write its value in the DNN Users table or read from it when the user managment page is called.
Whoa! Take a step back here. Just because the generated ID is dynamic doesn't mean you can't or shouldn't use the custom profile properties table. Take this example:
SELECT PropertyDefinitionId from ProfilePropertyDefinition where PropertyName = 'MyPropertyName' and PortalID = 0
This will get you the PropertyDefinitionId for you for a custom property. Now lets take it a step further... perhaps you want to grab user information where they have a certain value for a certain property. Try this (this is dynamically generated SQL I pulled from a module I wrote at work... it has a lot of junk in there but illustrates my point perfectly):
SELECT Users.UserID, Users.Username, Users.FirstName,
Users.LastName, Users.IsSuperUser, Users.AffiliateId,
Users.Email, Users.DisplayName, Users.UpdatePassword,
UserPortals.PortalId, UserPortals.Authorised FROM Users
LEFT OUTER JOIN UserPortals ON Users.UserID = UserPortals.UserId
LEFT OUTER JOIN UserProfile AS UserProfile_Responsibilities
ON Users.UserID = UserProfile_Responsibilities.UserID AND
UserProfile_Responsibilities.PropertyDefinitionID =
(SELECT PropertyDefinitionId from ProfilePropertyDefinition
where PropertyName = 'Responsibilities' and PortalID = 0)
LEFT OUTER JOIN UserProfile AS UserProfile_Other_Language
ON Users.UserID = UserProfile_Other_Language.UserID
AND UserProfile_Other_Language.PropertyDefinitionID = (SELECT
PropertyDefinitionId from ProfilePropertyDefinition
where PropertyName = 'Other_Language' and PortalID = 0) LEFT OUTER JOIN
UserProfile AS UserProfile_Position ON
Users.UserID = UserProfile_Position.UserID AND
UserProfile_Position.PropertyDefinitionID =
(SELECT PropertyDefinitionId from ProfilePropertyDefinition
where PropertyName = 'Position' and PortalID = 0)
LEFT OUTER JOIN UserProfile AS UserProfile_Position_Long ON
Users.UserID = UserProfile_Position_Long.UserID AND
UserProfile_Position_Long.PropertyDefinitionID = (SELECT
PropertyDefinitionId from ProfilePropertyDefinition where
PropertyName = 'Position_Long' and PortalID = 0) WHERE
UserPortals.PortalId = @portalId1 AND UserPortals.Authorised =
@approved1 AND (UserProfile_Responsibilities.PropertyValue
LIKE @searchTerm1 OR UserProfile_Other_Language.PropertyValue
LIKE @searchTerm1 OR UserProfile_Position.PropertyValue LIKE
@searchTerm1 OR UserProfile_Position_Long.PropertyValue
LIKE @searchTerm1)
So one thing to note is that I'm using parameterized queries and, as mentioned, this is dynamic SQL so I built my filter "on the fly" based on user criteria entered in a search.
There is no reason not to use the custom profile fields section... it is quite useful and you don't have to worry about breaking upgradeability.
If you want information about how to write to those profile fields in your own code just post up and ask and besides myself several other developers can help steer you in the right direction there.