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  |  

Maximum ASP
  Ads  
Aspose - The .NET & Java component publisher
 


  Sponsors  

Meet Our Sponsors

Webhost4life, specialists in DNN hosting
Mad Development is a full service interactive agency focusing on the merge of design, technology, e-commerce, and affiliate marketing by providing total website solutions.
AspDotNetStoreFront - E-Commerce by Design - The Leading ASP.NET shopping cart platform for developers!
SteadyRain
DataSprings - Great Ideas. Always Flowing.
R2integrated - formerly bi4ce
 


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
16 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.

 


Cygnusoft Custom Software
Cygnusoft has been providing cutting-edge custom software solutions for 20 years. Cygnusoft is also a leading start-up incubator, helping our partners build successful new businesses.
www.cygnusoft.com
Digicon: DotNetNuke design and development
Digicon is based in Brisbane, Queensland, Australia
digicon.com.au
Live Visitor Tracking & Live Chat For DotNetNuke
Track your visitors in real time and add live chat for sales & support. Free Trial.
www.whoson.com

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