About Me

My photo
a Dynamic and Energetic guy.....

Tuesday, August 26, 2008

Add users programmatically into a SHAREPOINT cutomlist(VERY RARE)

private string setAssignedPeopleStirng(string pstrIDS)
{
try
{
string[] strArrNames = pstrIDS.Split(new char[] { ';' });
string strSend = string.Empty;
SPWeb web = MySite.AllWebs[WebSite];
SPUserCollection MLUserGroup = web.SiteUsers;
for (int count = 0; count <>
{
string strusreName = MLUserGroup.GetByID(int.Parse(strArrNames[count])).Name;
strSend += strArrNames[count].Trim() + ";#" + strusreName + ";#";
}
return strSend;
}
catch
{
return string.Empty;
}
}

No comments:

My Masters