TechArena Community

TechArena Community (http://forums.techarena.in/)
-   Software Development (http://forums.techarena.in/software-development/)
-   -   How to store Additional information in Database (http://forums.techarena.in/software-development/1097323.htm)

opaper 03-01-2009 07:39 PM

How to store Additional information in Database
 
Hi,
I want to store some additional information such as users IP Adress, Age, etc inside the database during registration. Can't guess which table to look out for to insert additional information. Will it be aspnet_Membership or aspnet_Users.

Thanks

kelfro 03-01-2009 07:52 PM

Re: How to store Additional information in Database
 
Hi,
Why dont you create your own table alongwith the custom coloumns then use the USERID to correlate it to the correct USER via the USER table, either as a foriegn key or the way the Standard Asp.Net 2.0 membership provider does it with the other tables.

Try learning from Standard Membership Schema (the aspnet db) in SQL Management Studio and study the schema as well as the providers and classes in the Standard ASP.NET 2.0 Membership flow doing this you will have a good grasp over how it all fits together. Then after you see how Microsoft fits it's tables together and relates them, there's no reason you can't follow the same pattern and add your own tables, but it's important that you know how the whole thing fits together as to not overwrite built in functionality or otherwise conflict with it.

Microsoft uses the built in USER table and it's unique ID to relate that user with all the other tables that come with the built in membership you can create your own tables and persist the membership data you want as well using the same approach and relations with the unique USERID.

Modifier 03-01-2009 07:55 PM

Re: How to store Additional information in Database
 
This is best handled by using the Profile Provider. Like the Membership Provider, there's some configuration work you need to do to get started, but it doesn't require much coding to make it work.

The standard profile data are stored in a blob field in the database, so I prefer to use the Table Profile Providers. These providers let you store each data element in its own column, which I think is a little easier.


All times are GMT +5.5. The time now is 09:01 AM.