Small width layout Medium width layout Maximum width layout Small text Medium text Large text
     Search
Downloads Downloads Directory Directory Forums Forums Forge Forge Blogs Blogs        Marketplace Marketplace Careers Program Careers
Community › Forums Register  |  

PortalWebHosting
  Ads  
Active Modules -- Active Forums for DotNetNuke
 


  Sponsors  

Meet Our Sponsors

Red-Gate Software
MaximumASP
SourceGear - Tools for Developers
.: CounterSoft :.
telerik
ExactTarget email software solutions
 


DotNetNuke Forums
 
  Forum  General DotNetN...  Extend It! ( Pr...  BC30469: Reference to a non-shared member requires an object reference
Previous Previous
 
Next Next
New Post 8/15/2008 1:12 PM
User is offline jake
6 posts
10th Ranked


Re: BC30469: Reference to a non-shared member requires an object referencerian 

 for some reason the role controller's addrole procedure is returning -1. what am i doing wrong here?

Thanks in advance, here's the code:      

 

        Dim rc As New DotNetNuke.Security.Roles.RoleController
        Dim ri As New DotNetNuke.Security.Roles.RoleInfo
        Dim i As Integer

        ri = rc.GetRoleByName(0, "CustomerContacts")
        If ri Is Nothing Then
            ri = New DotNetNuke.Security.Roles.RoleInfo
            log.AppendLine("CustomerContacts role does not exist, adding...")
            ri.RoleName = "CustomerContacts"
            ri.Description = "Customer contacts for Baytek International"
            ri.PortalID = 0
            ri.IsPublic = False
            ri.AutoAssignment = False
            ri.ServiceFee = "0.0"
            ri.BillingPeriod = 6
            ri.BillingFrequency = "Month"
            'ri.TrialFee = 0.0
            'ri.TrialPeriod = 0
            'ri.TrialFrequency = Nothing
            i = rc.AddRole(ri)
        Else
            log.AppendLine("CustomerContacts role exists, skipping...")
        End If

 

 

 
New Post 8/15/2008 2:10 PM
User is offline jake
6 posts
10th Ranked


Re: BC30469: Reference to a non-shared member requires an object referencerian 

 

after doing some digging i found that the addrole stored procedure uses this to return the id of the last record that was entered:

SELECT SCOPE_IDENTITY()

there are no exceptions it just returns -1.

 
New Post 8/15/2008 3:29 PM
User is offline jake
6 posts
10th Ranked


Re: BC30469: Reference to a non-shared member requires an object referencerian 

 

after some more digging i found that there was an exception.

hit a foreign key constraint on rolegroupID

setting the rolegroupid to -1 fixed the problem.

I wonder why no one else had this problem?

 
New Post 9/14/2008 6:18 PM
User is offline Burldo
19 posts
10th Ranked


Re: BC30469: Reference to a non-shared member requires an object referencerian 

Had the same problem getting the AddRole to work, setting the roleGroupId to -1 fixed that. Using 4.9 now also.

Thanks, Burl

 
Previous Previous
 
Next Next
  Forum  General DotNetN...  Extend It! ( Pr...  BC30469: Reference to a non-shared member requires an object reference
 


Forum Policy

These Discussion Forums are dedicated to the discussion of the DotNetNuke Web Application Framework.

For the benefit of the community and to protect the integrity of the project, please observe the following posting guidelines:

1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DotNetNuke.
2. Discussion or promotion of DotNetNuke product releases under a different brand name are strictly prohibited.
3. No Flaming or Trolling.
4. No Profanity, Racism, or Prejudice.
5. Site Moderators have the final word on approving/removing a thread or post or comment.
6. English language posting only, please.

 


Hosting for DotNetNuke
SiteGround.com is the best place to host your DotNetNuke website! Expert DotNetNuke support, reliable servers, low price!
www.SiteGround.com
Code Endeavors, LLC
Do you Endeavor to Enhance your DotNetNuke designs by utilizing AJAX technologies to more efficient interactive web experiences
www.codeendeavors.com
T-WORX, INC.
Professional DotNetNuke Solutions
www.t-worx.com

DotNetNuke Corporation   Terms Of Use  Privacy Statement
DotNetNuke®, DNN®, and the DotNetNuke logo are trademarks of DotNetNuke Corporation
Hosted by MaximumASP