MOSS Forum

 
Home » Forum » MOSS       Ask a questionRSS Feeds

Adding Users using OM -MOSS

  Asked By: Colin Stephens         Date: Mar 24, 2010      Category: MOSS      Views: 392
 

When I try to add users to a top level site using Spweb.users.add method i am
getting an error "operation is not valid due to current state of the object".

If any one has the solution pls send me the solution

Tagged:          

 

2 Answers Found

 
Answer #1       Answered By: Latisha Schneider          Answered On: Mar 24, 2010       

I have checked the WSS SDK and I can see that there is no method
called users  in SPWeb class, instead Users is a property which is
used for retreiving information about users who are explicitly added
to a given site.
Please refer to the SDK for more information....

 
Answer #2       Answered By: Nora Maxwell          Answered On: Mar 24, 2010       

Yes your right. But Spweb.users will return a Spusers collection object. in
that there is a method  add. using this method we can add users  to the website.

I have resolved the problem. Actually the problem is with spcontext object. So
I used SpMembershipprovider class and solved the problem.

 
Didn't find what you were looking for? Find more on Adding Users using OM -MOSS Or get search suggestion and latest updates.


Your Answer
  • Answer should be atleast 30 Characters.
  • Please put code inside [Code] your code [/Code].