Quantcast
Channel: SharePoint 2010 - Development and Programming forum
Viewing all articles
Browse latest Browse all 11571

error while adding a FBA user to sharepoint site collection group

$
0
0

Hi

I have a FBA site. I created a user in Active Directory(AD) and was trying to add this user in the site collection group from my sub site. Almost 70% times it is creating success fully. But 30% time I am getting an error in " The user does
not exist or is not unique." in the code  at the location

string username="testUser"; //User name created in AD

string fbaprovider="i:0#.f|aduser|";

string fbaUser=fbaprovider+username;

oWeb.SiteUsers.Add(fbaUser, email, username, ""); //Error occur in this part

But while I am debugging the code the error doesnot come.This error comes only some times.Most of the tim everything works fine while adding a user to sharepoint group.If this error occurs while debugging the code then I could have got a solution.But it works fine while debugging :( .

I have referred the link

http://social.msdn.microsoft.com/Forums/sharepoint/en-US/d4c6cc77-a36b-44fa-b02d-2f9d3ad59f0f/adding-fba-user-to-sharepoint-group

But it didn't help me at all

Please help me in getting a solution.

Regards

Jibin Koshy



Viewing all articles
Browse latest Browse all 11571

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>