Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Fred Ramsey 5 posts 25 karma points
    Sep 02, 2010 @ 14:44
    Fred Ramsey
    0

    Accessing user data and custom fields

    I want to essentially add a custom field to the user record. What's the best way of doing that? And to let the admin fill in that custom field?

    Secondly, I want to create and access custom tables in the database. I'm not really getting how that is done from the tutorials. Advice?

    Third, I would like to be able to access these custom tables, as well as the user table, from outside Umbraco by accessing the database directly. Is this possible?

    Thanks so much.

  • Sascha Wolter 615 posts 1101 karma points
    Sep 09, 2010 @ 23:32
    Sascha Wolter
    0

    Hi Fred,

    hope this is still relevant to you:

    1. You can add custom fields to members (aka website users) by adding properties to the member type. These can then be filled out by CMS users or can programmatically be populated e.g. when a user signs up.

    2. You can add custom tables to the Umbraco database to your liking, as well as stored procedures, views etc (in the case of a MS SQL database server). You can then access these tables from custom .Net controls (how that is done is shown in the foundation developer videos). You can find lots of information on how that is done one the web, e.g. by using the DbCommand object.

    3. Accessing the database directly from outside the Umbraco application is generally not advisable. Not because it is Umbraco but because you create security and threading issues (and whatnot). Practically you can do so though, just be aware that it might come at a price. A better way to open up your custom tables to other application would be to create a .Net service layer (e.g. custom web services) in the Umbraco application, when other applications access the web services it is the Umbraco app who accesses the tables.

    Hope that helps,

    Sascha

Please Sign in or register to post replies

Write your reply to:

Draft