Custom ASP.NET DB memebership fields

codeplex
sharepoint2013

#1
Hi,
I added some custom columns in the aspnet_Membership table, and I am wondering how to access those new fields from the FBA tool source code, where I need to add custom logic to the SharePoint behavior. So the problem is how to connect to the database from the tool and manipulate those fields. Any help will be highly appreciated.

Thanks!

#2
Everything is managed through the membership provider - so the FBA Pack doesn't actually do any direct access to the database. I suggest you take a look at profile providers - which essentially adds columns for each user, but through a provider:

http://msdn.microsoft.com/en-us/library/aa478953.aspx

Alternatively, if this is all internal, you can use standard .net methods to query/update the database (Not best practices, but it will work).

Myself, when I need extra fields, I usually add it to the SharePoint user's profile - so I update SharePoint, not the membership database.

#3
Thanks for the quick response! If I decide to use the profile providers, how can do it in the FBA tool? Sorry if the question is lame, I am new to SharePoint development and FBA tool.

Thanks!

#4
I'm guessing this is how it is done (I've never used the profile provider myself - I store everything in the SharePoint user's profile):

http://www.vbforums.com/showthread.php?542586-Using-the-Profile-Provider-in-ASP-Net-2-0

#5
I`ve found a way to use custom membership fields.

Thanks a lot for your help :)

#6
Great! Which way did you end up going? Profile provider? SharePoint Profile? Direct DB Access?

#7
Direct DB Access :)

Profile Provider took us in a lot of troubles, but direct DB access did the job.