mina ssaaa

mina ssaaa

  • NA
  • 22
  • 5.8k

An exception of type 'Microsoft.SharePoint.Client.ServerExce

Sep 30 2016 9:42 AM

I have the following error

An exception of type 'Microsoft.SharePoint.Client.ServerException' occurred in Microsoft.SharePoint.Client.Runtime.dll but was not handled in user code

Additional information: Value does not fall within the expected range.

 
when i want to upload data from sharepoint and i don't know why i have ths error message. can you help me please? below is my code in c#.
 

ar profile = GetProfileForGuid(item.Tag.ProfileGuid);

var clientContext = SPCredentialManager.GetSPContext(profile, item.Tag.WebUrl);

// ClientContext clientContext = new ClientContext();

// clientContext.AuthenticationMode = ClientAuthenticationMode.FormsAuthentication;

// clientContext.FormsAuthenticationLoginInfo = new FormsAuthenticationLoginInfo("kcs\ras", "Shahram123!");

List oList = clientContext.Web.Lists.GetByTitle(item.Header);

CamlQuery query = CamlQuery.CreateAllItemsQuery();

//CamlQuery camlQuery = new CamlQuery();

// camlQuery.ViewXml = "<View><RowLimit>100</RowLimit></View>";

ListItemCollection collListItem = oList.GetItems(query);

clientContext.Load(collListItem);

clientContext.ExecuteQuery();

 

Answers (1)