Last post May 27, 2009 08:37 AM by Spider Master
May 25, 2009 08:33 AM|tomehhh|LINK
I would like to add Comment field to Register.aspx page, I tried to change aspnet_Membership_CreateUser Stored Procedure
but it does not work. Any help?
May 25, 2009 11:01 AM|darkknight187|LINK
The stored procedure is part of it, but there's several other steps.
And I think you were trying in the main members database,
I would use the classifieds database in the members table.
I'm quoting off the top of my head, so it could be wrong.
But it should get you on the right track.
First off you need to make a backup of your project just in case you screw up.
Then in the classifieds database add a column to the members table named comment.
I would set the new column as nvarchar(100)
The 100 limits the characters allowed to be inserted into the database.
Add to the storedprocedure insert member.
Add to App_Code/BLL/Members (In the insert member section) Should be set as string, if you used nvarchar.
Take note of what order you put comment, it's very important in the next step.
And you will see an error until you do the next step.
Open App_Code/DAL/members, add comment to the list.
Make sure you change the properties too.
Just compare to the others, and you should enter 100 for the max charachters here too.
Still in the last file, right click on the background, and choose view code.
Scroll down the insert members section, and add comment to it, here's where the order is important.
And of course add to your register and myprofile page.
Make sure you test if the user registers without adding a comment.
Does that cause errors when viewed in myprofile?
If so you should add a default on the register page.
May 26, 2009 06:21 AM|tomehhh|LINK
In aspnet_Membership table there is already a field named Comment - I would like to use that field. I have modified the stored procedure
aspnet_Membership_CreateUser and here is the error I get:
Procedure or function 'aspnet_Membership_CreateUser' expects parameter
'@Comment', which was not supplied.
Here is the stored procedure: (I have modified order of fields in aspnet_Membership table so Comment field comes after PasswordAnswer):
Whereever is mentioned PasswordAnswer I have added Comment field below.
May 27, 2009 08:37 AM|Spider Master|LINK
Hello again [:D]
I think your approach is a little off course (in the wrong direction)
With the aspnet default member database I would recommend never modifying this until such understanding is known to you.
The database is used by aspnet server by using pre established code that can be overidden at run time how ever the functionality of inserting a comment to the users table is allready provided using MembershipUser.
I would suggest rolling back to the orginal StoredProcedure and using the MembershipUser namespace with update methods to add in your comment.
Hope this helps