More in this section

Forums / Developing with Sitefinity / Link to telerik_Users table.User using Nolics

Link to telerik_Users table.User using Nolics

7 posts, 0 answered
  1. Jeff
    Jeff avatar
    5 posts
    Registered:
    10 Apr 2008
    21 Jul 2008
    Link to this post
    How would I go about to link a dbclass file, let say dbclass Account to a user in the telerik_users table.

    Thank you, any response would be greatly appreciated.

    Jeff
  2. Pepi
    Pepi avatar
    981 posts
    Registered:
    31 Jan 2017
    23 Jul 2008
    Link to this post
    Hi Jeff,

    Here is an example of how to achieve this:

    namespace Telerik.DataAccess.AspnetProviders; 
     
    dbclass Account [TableName="telerik_Account"] { 
        primary key guid AccountId; 
        link User User_lnk: UserId; 

    Hope this helps.

    All the best,
    Pepi
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. Guenni
    Guenni avatar
    8 posts
    Registered:
    14 Jul 2008
    28 Jul 2008
    Link to this post
    Hi,
    I also needed a link to the telerik_users table.
    I added the mentioned telerik namespace and the link 
        ( link telerik_Users User_lnk: guid UserId; )

    I get an error in the Database1.Designer.cs when I build the project. 
     The type or namespace name 'telerik_Users' could not be found (are you missing a using directive or an assembly reference?) 

    How can I solve this problem?
    Thank you for any response.
  4. Guenni
    Guenni avatar
    8 posts
    Registered:
    14 Jul 2008
    29 Jul 2008
    Link to this post
    It obviously doesnt see the Telerik tables
    cause a link to a table created with Nolics self, causes no problems


    ~Guenni~
  5. Vlad
    Vlad avatar
    498 posts
    Registered:
    19 Jun 2017
    30 Jul 2008
    Link to this post
    Hello Guenni,

    The problem is in this line of code:  link telerik_Users User_lnk: guid UserId;
    There is no class telerik_Users.

    The name mentioned in the example is link User User_lnk: UserId

    The name of the table in the database is telerik_Users, but the class which represents it in the API is User.
    The full type name is: Telerik.DataAccess.AspnetProviders.User.


    Let us know if you need more instructions.

    Best,
    Vlad
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  6. Guenni
    Guenni avatar
    8 posts
    Registered:
    14 Jul 2008
    30 Jul 2008
    Link to this post
    Hi Vlad,

    Thnx for the reply. Still I remain confused here, I'm prompted another error in the dbclass.
     Custom tool error:  Unknown field type UserId 

    Which leads to an error in the .Designer.cs
     A namespace does not directly contain members such as fields or methods 

    I don't understand why this error is given, could you pls clarify.
    I'd appreciate it

    ~Guenni~
  7. Vlad
    Vlad avatar
    498 posts
    Registered:
    19 Jun 2017
    31 Jul 2008
    Link to this post
    Hi Guenni,

    The provided code bellow is to demonstrate how to set a link to an external table, it is not a complete solution. So if the UserId field is not defined, you should define it:

    namespace Telerik.DataAccess.AspnetProviders; 
     
    dbclass Account [TableName="telerik_Account"] { 
        primary key guid AccountId; 
        link User User_lnk: guid UserId; 

    or use another field for the link, e.g. AccountId:

    namespace Telerik.DataAccess.AspnetProviders; 
     
    dbclass Account [TableName="telerik_Account"] { 
        primary key guid AccountId; 
        link User User_lnk: AccountId; 

    Please have a look at the Nolics.net documentation for more information.

    All the best,
    Vlad
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Register for webinar
7 posts, 0 answered