Sitefinity ASP.NET CMS - Content Management System

Support Forum Thread

Home >  Support >  Forums home > Sitefinity 3.x > Developing with Sitefinity > Link to telerik_Users table.User using Nolics

Reply
Jeff, 7/21/2008 1:25:05 PM
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

Reply
, 7/23/2008 2:35:29 AM
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

Reply
Guenni, 7/28/2008 3:10:29 PM
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.

Reply
Guenni, 7/29/2008 2:08:15 PM
It obviously doesnt see the Telerik tables
cause a link to a table created with Nolics self, causes no problems


~Guenni~

Reply
, 7/30/2008 9:28:13 AM
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.

Reply
Guenni, 7/30/2008 11:11:25 AM
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~

Reply
, 7/31/2008 6:01:06 AM
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.